Rich-text Reply

Google Analytics Dimensions Not Working

fpodoo 07-28-14

Google Analytics Dimensions Not Working

Hello,

 

I setup Optimizely with analytics dimensions but when I go to Google Analytics, I have no dimension reported.

 

Page to check: https://www.odoo.com/page/crm

 

Note that:

 

  • I followed the optimizely manual to activate analytics
  • Optimizely is loaded before the analytics tracker
  • The setup has been made a few days ago
  • I previously made a mistake by loading analytics before optimizely, but I fixed it

For technical reasons, we use the variable "_gaw" instead of "ga" with universal analytics. I checked the .JS code of optimizely and it seams optimizely is using the "ga" variable statically. So, we added a window.ga = _gaw but it does not seems to work.

 

Can you help fix the issue?

 

Thanks,

Level 1

Gary 07-28-14
 

Re: Google Analytics Dimensions Not Working

Hey there!

 

This is a great question, and looking at the code on your page, you're ALMOST on track with what you're trying to do.

Here's [some] of your code:

 

 

     window.ga = _gaw;
     window.optimizely = window.optimizely || [];
    window.optimizely.push("activateUniversalAnalytics");

    _gaw('send','pageview');

 

-------

 

The order of this part will not work, as you're defining ga as equal to _gaw, and then Optimizely pushes information into 'ga'. The reason this doesn't work is because the pageview call that is then sent, is ONLY for '_gaw' - so none of your Optimizely information would be sent in the call.

 

Another way to do this might be to pull out the information from the ga object which Optimizely pushes in, but this becomes very complex.

 

We do have another solution which requires some custom code which requires a bit of tweaking, so we are not posting this online, but I'd be happy to send this to you. Would you mind emailing me at support@optimizely.com ?

 

All the best,

Gary

- Gary
Optimizely - Turning the World's data into action
Optimizely
Joe_GRP 09-18-14
 

Re: Google Analytics Dimensions Not Working

I am having the same problem as Gary.

 

I setup Optimizely with analytics dimensions but when I go to GoogleAnalytics, I have no dimension reported.

 

Page to check: http://iautos.co/car-refinance/

 

I did the following:

 

  • I followed the optimizely manual to activate analytics
  • Optimizely is loaded before the analytics tracker
  • The setup has been made a few days ago

 

Does the Analytics code snippet need to be placed after the Optimizely code on the page? 

Level 1
Gary 09-18-14
 

Re: Google Analytics Dimensions Not Working

Hi Joe,

Yes, the Optimizely Snippet should be at the top of your <head> block. Then, within your UA code will be the code I pasted above for activating the UA integration in Optimizely.

Looking at your page, Please move the Optimizely Snippet above your UA code, then add these two lines above your ga(send, pageview) line of code:

window.optimizely = window.optimizely || [];
window.optimizely.push("activateUniversalAnalytics");

That should help!
- Gary
Optimizely - Turning the World's data into action
Optimizely
miflora_de 01-26-15
 

Re: Google Analytics Dimensions Not Working

Hi Gary,

 

we did everything exactly as described above (and in the official tutorial) but it seems like Google Analytics won't recognize our Optimizely Index.

 

We use the same index in Optimizely as well as in GA.

GA doesn't recognize our personalized audience (the session value stays at 0).

 

Our site is www.miflora.de

 

Thanks a lot in advance,

 

Julius