Integrating Webtrends Optimize with Google Universal Analytics

There are a couple of ways to send your experiment views into Google Analytics. This considers how to acheive this by sending data directly to Google Analytics.

While we don't have a dedicated option in the UI yet, we're going to piggy-back the alternate Google Analytics via. GTM implementation

Step 1: Enable the integration in Manage Integrations

To get started, launch the top nav, and find Manage > Integrations.

Next, use the button in the top-right corner to start a New Integration

Then, find Google Analytics (via. GTM) and click Install Integration

Step 2: Customise the code

We're going to make a few tweaks to the code in this integration, so that instead of sending data to Google Tag Manager (GTM), it sends it directly to Google Analytics.

When in the Edit Integration screen, click CODE

Replace the code with this:

window.ga('send', 'event', `{{eventCategory}}`, `{{eventAction}}`, `{{eventLabel}}`, {
  nonInteraction: true
});

If you wish to change what gets passed through in Event Category, Action or Label, you can configure them in the Settings panel. Also, you may wish to include Custom Dimensions in the above code, to facilitate more powerful reporting.

Also, note that if you have a named tracker, you'll need to replace 'send' with 'trackername.send'. For example, if your tracker is called "gtm2", the code should be:

window.ga('gtm2.send', 'event', `{{eventCategory}}`, `{{eventAction}}`, `{{eventLabel}}`, {
  nonInteraction: true
});

If you would like to change any other settings, now is the right time to. Once ready:

  • Flip the toggle switch
  • Pick the tags you'd like this to apply to (ALL is fine, if you don't need to QA-test this change)
  • Hit Save

Assuming there's nothing else you'd like to configure, your integration is now live for all users and so you can stop here.

Step 3: Validating data collection

There are a few things you can do to validate data is being sent or collected.

  • Once you fall into a test, open the Console in Developer Tools and type in window.dataLayer. Search through the entries that show up, and see if you spot an event matching the tag that you built.
  • Check network requests. Filter by the word "collect" (no quotation marks) and inspect calls going out to Google Analytics. Make sure you can see our data in one of those calls - typically one of the last ones you see in the list.
  • Check your reports in Google Analytics. Realtime events are a decent place to look first - it'll typically take a little while to roll-up into other reports.