Issues with Universal Object (ga) ? – Rename the global object
-
The latest version wasnt working for me, and I found that renaming the universal GA object solved all issues. leaving “ga” is open for conflicts.
Was getting “ga is not defined” errors on link tracking
Recommend changing as per google’s documentation: https://developers.google.com/analytics/devguides/collection/analyticsjs/advanced?hl=en
In some cases the ga variable name might already be used by an existing object on your page. To avoid overriding your existing object, you can rename the ga function, for example to __gaTracker. To do this, simply replace the ga.
I renamed ga to “__gaTracker” and everything is working
Classes changed:
frontend/views/tracking-universal.php
frontend/class-universal.phphttps://www.ads-software.com/plugins/google-analytics-for-wordpress/
- The topic ‘Issues with Universal Object (ga) ? – Rename the global object’ is closed to new replies.