Error while setting Custom Dimension
krisvasudevan opened this issue · 1 comments
Hi,
Based on the documentation here[https://developer.matomo.org/api-reference/PHP-Matomo-Tracker], it says that setCustomDimension function is available to set values of custom dimensions using the PHP tracker code.
However, when I put this in my PHP script like below:
`<?php
require_once "assets/custom/php/matomo_tracker.php";
MatomoTracker::$URL = '/matomo';
$matomoTracker = new MatomoTracker( $idSite = 1 );
$matomoTracker->setTokenAuth('<auth_token>');
$matomoTracker->doTrackPageView('Home');
$matomoTracker->setCustomVariable(1,$user_details['firstName'][0] . " " . $user_details['lastName'][0]);
?>`
It throws an error in my log files: PHP Fatal error: Uncaught Error: Call to undefined method MatomoTracker::setCustomDimension() in /var/www/html/index-analytics-php.php:19
Is the document mentioned earlier referring to some other PHP library?
Thanks,
Any help is appreciated,
Krishna Vasudevan
This is the repository for the Android SDK.