Skip to content

Current version is 2.1. Repository contains the code used by this custom integration (for reference only) and a JSON file that can be imported into your GTM environment via the 'Import container' functionality. Once imported, it will create all the necessary GTM properties used by this integration.

Notifications You must be signed in to change notification settings

michal-optimizely/google-analytics-optimizely-gtm-integration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

Optimizely & Google Analytics via GTM analytics integration

Supporting files for setting up the integration between Optimizely and Google Analytics when GA is implemented via Google Tag Manager. For a detailed overview of the integration setup refer to Optimizely's documentation.

Content

  • Optimizely Integration Code (html/js): code used inside the custom HTML Tag named "Optimizely Integration Code". Included here only for reference purposes.
  • GTM Import Container (json): a JSON file that you can import into GTM. It includes all the necessary Tags, Triggers and Variables used by this integration.

Instructions when using the JSON file

  1. Download the gtm-import-container.json file.
  2. Upload it to your GTM using Admin > Import Container. Use the Merge import option to avoid overwriting and/or deleting any existing properties. If you're updating the integration from previous version, select the option to 'Overwrite conflicting tags, triggers and variables.' (Note this won't fully work if updating from version 1.0 due to some discrepancies in the names of individual properties; you will need to manually delete the old properties in that case.)
  3. Optimizely Campaign Decided & Optimizely Referrer Override tags need to be updated to know what GA tracking ID they should be using. [repeat this for both tags] Open the tag settings and find the Google Analytics Settings field. You have two options:
  • You can use the Google Analytics Setting Variable. This variable needs to be created manually and populated with the GA tracking ID, it's not provided by default. If you select this option, make sure to leave the *Tracking ID field right below the Enable overriding settings in this tag option empty.
  • If you don't have/don't want to use the Google Analytics Setting Variable, keep the Enable overriding settings in this tag option checked and enter your own GA tracking ID in the Tracking ID field right below (it will be pre-populated with a value 'UA-000000-0' - this is not correct and needs to be overwritten with your own GA tracking ID).
  1. Publish the workspace.
  2. In Optimizely, enable the Google Analytics integration for any experiment you want to analyze in GA.

Properties created in GTM via this import

Tags:

  • Optimizely Campaign Decided
  • Optimizely Integration Code
  • Optimizely Referrer Override

Triggers:

  • Optimizely Campaign Decided
  • Optimizely Referrer Override

Variables:

  • optimizely-dimension-number
  • optimizely-dimension-value
  • optimizely-referrer

Changelog

  • Version 2.1 (latest)
    • Removed automatic logging (no impact on the functionality of the integration).
    • Removed custom variable unrelated to this integration from the exported GTM container.
    • Expanded readme file instructions.
  • Version 2.0:

Issues?

If you run into any issues while setting up the integration, reach out to Optimizely via a Support ticket.

Credits

Spencer Smitherman is the autor of the original 11-step process and the v1.0 of integration code.
Nebo Agency first came up with the idea of using the Import Container functionality to simplify the process.

About

Current version is 2.1. Repository contains the code used by this custom integration (for reference only) and a JSON file that can be imported into your GTM environment via the 'Import container' functionality. Once imported, it will create all the necessary GTM properties used by this integration.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages