php-ga-measurement-protocol
php-ga-measurement-protocol copied to clipboard
Uncaught exception 'BadMethodCallException' with message 'Method setDebug not defined for Analytics class'
It looks like there is no method setDebug as explained in the docs. I copy pasted the code and the error was thrown.
You are either:
- Using
v1
, which lacks newer features such as Debug and Hit validation (this is in the README) or - Using a very old version of
v2
To fix this, you can update to the latest version:
composer require theiconic/php-ga-measurement-protocol ^2.0
This should upgrade you to v2.7.1
which is the latest.