Google Analytics
Google Analytics Integration:
To integrate your Webtrends Optimize® tests with Google Analytics®, you will need to make data available for Google Analytics, so that it can identify the name and variation of the tests you are running on Optimize.
- During the test set up process at step 2 “Test Details,” you can add custom code to the post-rendering and variation scripts.
- Click “Edit” within the ‘Post-Rendering Script’ section.
- Add the following custom code into the ‘Post-Rendering Script’ window:
WT.addEventHandler(‘pageview’, function(e)
{
dataLayer.push({
‘WT_test’: ‘name of the test‘,
‘WT_variation’: thislevel,
‘event’: ‘webtrendsEvent’});
});
- Replace name of the test with the test name you want to pass to your Google Analytics dashboard.
- Define thislevel variable in ‘Variation Script’ for each of the variations contained in the test
- Click to open the ‘Variation 1’ script.
- Add the following custom code into ‘Variation 1’ script window.
var thisLevel = “Variation 1“;
- Replace Variation 1 with the name you want to appear in Google Analytics for ‘Variation 1’.
- Repeat for ‘Variation 2’ and all other test variations.