Push Convert data to GA using Custom Dimensions
If you want to push Convert data to Google Analytics using Custom Dimensions, you can do it with two different ways:
- Integrate Convert with GA: Use the Experiment Settings and enable the integration with GA by assigning a specific GA Custom Dimension.
- Use GTM datalayer to push Convert data to GA: Create a GTM tag and define the appropriate variables and dimensions to push Convert data to a specific GA Custom Dimension.
Then you can view Convert data inside GA through Customisation > Custom Reports.
Push Convert data to GA using Event Tracking
However, there might be a case where you do not want to touch your GA Custom Dimensions. In that scenario, you can use GA Event Tracking. Depending on the version of GA that you use, find some useful documentation here on the commands that you should use:
- Event Tracking in GA Legacy (ga.js): https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide
- Event Tracking in Universal Analytics (analytics.js): https://developers.google.com/analytics/devguides/collection/analyticsjs/events
- Event Tracking in GTAG (gtag.js): https://developers.google.com/analytics/devguides/collection/gtagjs/migration#track_events
Then you can view Convert data inside GA through Behaviour > Events.
Below we describe how this is possible.
Add Global Project Javascript
Go to your Convert Project settings and add this code:
/* Push Convert data to GA with Event Tracking */
setTimeout(function(){
if (ga){
var exp = convert.currentData.experiments;
var number_of_experiments = Object.keys(exp).length;
var loop_counter = 0;
var reporting_string = '';
for (var expID in exp){
reporting_string = reporting_string + 'e:' + expID + '=' + 'v:' + exp[expID].variation_id;
if (loop_counter < (number_of_experiments - 1)) {
reporting_string = reporting_string + '|';
}
loop_counter++
}
var trackername = window.ga.getAll()[0].get("name");
ga('create', trackername, 'auto');
ga(trackername+'.send', 'event' ,'Convert', reporting_string, true);
}
},1000);
/* End of code*/
- If you use ga.js, then you have to use _gaq.push.
- If you use analytics.js, you need to use ga('send'...) like in the code example above.
- If you use gtag.js you should use the new syntax with gtag('event'...).
The methods are not interchangeable, they belong to three different versions of the Google Analytics tracking code.
View Convert Data in GA
Once the experiment runs, you can go to GA > Behaviour > Events > Overview (or Real Time Events) and see the Convert data:
Comments