php-ga-measurement-protocol icon indicating copy to clipboard operation
php-ga-measurement-protocol copied to clipboard

Uncaught exception 'BadMethodCallException' with message 'Method setDebug not defined for Analytics class'

Open ghost opened this issue 7 years ago • 1 comments

It looks like there is no method setDebug as explained in the docs. I copy pasted the code and the error was thrown.

ghost avatar Jul 17 '17 16:07 ghost

You are either:

  1. Using v1, which lacks newer features such as Debug and Hit validation (this is in the README) or
  2. 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.

jorgeborges avatar Aug 20 '17 01:08 jorgeborges