Optimizely and Google Tag Manager
We are almost finished with a Universal Analytics/ GTM upgrade and I'm having a problem with passing through the Custom Dimension using GTM.
We have manually added the project code to the site (not through GTM), how should we track the Custom Dimension to ensaure that it fires from GTM to our analytics account?
Would I just use a normal pageview/ event tag and then fire the Custom Dimension as part of this?
Sorry if the question is a bit jumbled!!
If I understand your question correctly, you're trying to get Optimizely to pass data to UA while also using GTM.
For the UA part of the integration, you can follow the instructions in this article and you should have it set up correctly: https://help.optimizely.com/hc/en-us/articles/200039995-Integrating-Optimizely-with-Google-Analytics...
For the GTM part of the integration, here's what we've seen work:
1. In GTM, turn on the "Tracker Name" setting, but don't fill anything in the text box.
2. Then go to "Create New Rule" and create a rule called something like "All Pages after Optimizely"
3. Specify the following conditions:
URL matches Regex .*
Event equals optimizely_loaded
So your tag in GTM will look like:
For more information on the Optimizely/GA/GTM integration, I recommend this description (written by one of our customers): http://easyart.github.io/2013/10/16/setting-up-google-tag-manager-with-optimizely/
Please let us know how that works for you!
I use Google Tag Manager quite a bit and in general recommend that clients don't deploy any A/B testing tags via GTM. Your optimizely tag may occasionally take some time to load and result in a sub-optimal experience for the customer. Googles official line has also been that GTM doesn't support A/B testing tags.
The main reason for this is that the GTM tag needs to go in the body to work reliably across browsers. Secondly GTM fires tags asynchronously and in random order (although you can use some tricks to try to force tag firing order). As a result it's possible that your optimizely tag won't load until a portion or all of your page has already loaded. It probably won't happen but it could. For that reason I recommend clients to not use GTM to load their optimizely tags.
Brian -- that's a great point. If you can have Optimizely load in the head tag, outside of GTM, that's definitely a better approach. If you must load it in GTM, then my instructions above can help hook it up to GA.
I load the Optimziely project code through our code not GTM but it is not easy to understand how I should be firing the information from Optimizely (Project/ Variation name) into our GA account using GTM, though this may be due to my relative inexperience with Custom Dimensions over Custom Variables. It only seems to want one should I just pull through the Project & variation name into one Dimension?
Our team has followed all of the instructions to integrate Optimizely using Google Tag Manager. Our experiment appears to be running fine and the data is being captured within Optimizely's reporting tool. However, we can not get Optimizely data to appear in our custom dimension within Universal Analytics. We have followed all the instructions in current blogs, including checking the tracker option in GTM. We have also made a custom dimension specifically for the test and are setting it in the edit portion of the test. Is there anything else that we can try? What might we be doing incorrectly?
I have Optimizely code outside of GTM. I have UA set up through GTM. I want to use GTM to create custom dimensions to integrate Optimizely test data with UA. That's what I understood the question to be but I don't think that was what was answered but then again what do I know.
Can you point me in the right direction or clarify?
Hey @MalcolmX ,
Thanks for your question!
If you are using GTM to install UA onto your webpage, you can follow the instructions within our knowledge base to guide you with set-up to integrate Optimizely with UA, which you can find here: https://help.optimizely.com/hc/en-us/articles/203189220-Implementing-Optimizely-with-a-Tag-Manager#g...
Please let me know if I misunderstood your question or if I can help with anything else!
Manager, Technical Support