theiconic / php-ga-measurement-protocol

Send data to Google Analytics from the server using PHP. Implements GA measurement protocol.
MIT License
655 stars 136 forks source link

Social interactions broken #81

Closed flaviovs closed 4 years ago

flaviovs commented 4 years ago

The following call fails:

$instance->setSocialAction('like');

Error is:

Error: Call to undefined method TheIconic\Tracking\GoogleAnalytics\Parameters\SocialInteractions\SocialAction::setValue() in /app/vendor/theiconic/php-ga-measurement-protocol/src/Analytics.php:729

Same for $instance->setSocialActionTarget('http://example.com');.

Probable reason: classes in src/Parameters/SocialInteractions/SocialAction*.php don't inherit from TheIconic\Tracking\GoogleAnalytics\Parameters\SingleParameter.

alberto-bottarini commented 4 years ago

https://github.com/theiconic/php-ga-measurement-protocol/pull/84 https://github.com/theiconic/php-ga-measurement-protocol/pull/85

jorgeborges commented 4 years ago

Thanks for reporting @flaviovs, and thank you @alberto-bottarini for fixing.

I have released the patch version v2.7.2 with the fix.