MediaRon / gravity-forms-google-analytics-event-tracking

Use event tracking with Google Analytics
https://wordpress.org/plugins/gravity-forms-google-analytics-event-tracking/
GNU General Public License v2.0
65 stars 14 forks source link

Use client ID supplied by Google Analytics #20

Closed mariusvetrici closed 8 years ago

mariusvetrici commented 9 years ago

Hello,

I had a look at the code and in GATracking.php and the createClientID function checks for the '_ga' cookie which is not supported anymore by Google Analytics universal. Consequently, this code will always return a new user ID by calling generateUUID.

This means that the visitor data will not be linked to his events. Namely, the pageviews of the website will be tracked by Google Analytics client side script which uses one user ID, while the form submission will be tracked using the newly generated ID.

The way to extract that id on client side is described here: https://productforums.google.com/forum/#!topic/analytics/B6oiadB0PZk

ga(function(tracker) { var clientId = tracker.get('clientId'); });

but then we need a way to send it to the serverside script that sends the data to Google Analytics.

What do you think?

Thanks.

Marius

manuelfink commented 9 years ago

Hi,

I think this should be fixed, since it is really important to make the user association for conversion tracking (eg. in AdWords).

Why don't you fire the google analytics tracking events on client side? You could add support for both, manual ga universal analytics as well as seo by yoast.

Further client side tracking would also solve the issue with opt-outs and not tracking logged in users, since if google analytics is missing (eg. yoast removes ga for logged in users) no tracking would be fired. Also blocking ip or using a ga block plugin would be supported this way.

Best and thx for the plugin,

Manuel

ronalfy commented 8 years ago

Is this still valid? The documentation here says Google Analytics is using the _ga for the cookie for Universal Analytics.

https://developers.google.com/analytics/devguides/collection/analyticsjs/cookie-usage