This website works best with JavaScript enabled. Learn how to enable JavaScript.

How to Integrate VWO with UA via Google Tag Manager (Custom Dimensions)

Last updated

Integrating VWO with Google Tag Manager (GTM) allows you to push your VWO test data to Google Universal Analytics and other analytics tools via GTM.

ATTENTION This integration article is not meant for installing the VWO tracking code through Google Tag Manager, since we don’t recommend integrating VWO through GTM at all.

Note that you will need to set up the integration for every test you create:

  • Create Custom Dimension for VWO Tests
  • Create a GTM Variable
  • Set firing rules for the event
  • Create a new Tag in GTM
  • Enable GTM integration in VWO

Create Custom Dimension for VWO Tests

To configure the integration, you must first create a UA custom dimension.

  1. Sign in to your GA dashboard.
  2. Click Admin from the menu bar and then select the appropriate account and a property.
  3. Under Property, click Custom Definitions and then click Custom Dimensions.gtm1
  4. In the page that appears, click New Custom Dimension.gtm2
  5. In the window that appears, enter the following details:
    • Name: Enter a unique name for the dimension. Please note that you must create a separate dimension for each running test you want to integrate with UA. The dimension you create is used to identify and push VWO data into the corresponding dimension in UA. For example, VWO Test Id 1.
    • Scope: Select the User option from the list. Scope determines which hits will be associated with the custom dimension value. Click here to know more about scope.
    • Active: Enable this box to start collecting data and see the dimension in your reports right away.
  6. Click Create. You have now created custom dimensions in UA.

Create a GTM Variable

  1. Sign in to your GTM account and select the Container.
  2. Select Variables and then click New to create a variable.gtm4
  3. Furnish the following variable details:gtm5
    • Enter a name for the variable (usually corresponds to the dimension name you created for your UA integration).
    • Under Page Variables, select Data Layer Variable as the variable type.
    • In the Data Layer Variable Name field, enter Campaign-ID (replace ID with your VWO Test ID). For example, Campaign-1234. This value is case sensitive.
    • In Data Layer Version, select Version 1.
    • Enable Set Default Value option and set the value to 0.gtm6
    • Click Save to create the variable.

Set Firing Rules for the Event

Create an event rule that will enable VWO to push test data to GTM. Creating a rule fires the tag you defined.

  1. Select Triggers and then click New to create a new rule.gtm7
  2. Enter the name for the rule. In our example, it is set as “VWO Rule”.
  3. Under Trigger Configuration, select Custom Event as the trigger type.gtm8
  4. Put the Event Name as VWO It will always be VWO (do not change this event name).
  5. For the section This trigger fires on, select Some Custom Events.
  6. In the next field, select the variable created in the previous step from the drop down and set the condition as ‘does not equal‘ 0 (zero).

Create a New Tag in GTM

  1. Select the Tags option on the side panel and then click New to create a tag for the integration.gtm10
  2. Create tag for the service where you want to push the data from GTM by filling out the information:gtm11
    • Name: Enter a name for the tag you want to create. For example, GA is the name of the tag in our example.
    • Tag Type: In this field, specify the service to which you want to push the test data using GTM. Google provides a few default templates, but you can also use your custom tags. To view more details about the default templates, click this help center article.
      For example, if you want to push your Google Universal Analytics data, specify the tag type as Universal Analytics.
    • Track Type: In this field, select Event to track a specific action or event, such as button clicks, page visits.
  3. Under Event Tracking Parameters, enter the following information:
    • Category: VWO
    • Action: Custom
    • Non-interaction Hit: True
    • Select Enable overriding settings in this tag option
    • Tracking ID: In this field, enter the tracking ID of the data you want to push. For example, in our case, the UA tracking ID could be UA-1234567-1.
  4. Under Custom Dimensions, enter the following details:gtm14
    • Index: Select an index number (1-20) to associate with the Custom Dimension you specified. This is based on the custom dimension you have created inside your UA account to collect VWO data.
    • Dimensions: Enter the macro name here so as to push the data passed to GTM by VWO to UA.
    • Click Save to save changes.
  5. After you have created the tags, you need to associate the tags with firing rules. From Triggering > Firing Triggers section, select the trigger you had created to be associated with the tag.gtm15
  6. Click Save to set the firing rule.
  7. After completing the configurations, click Publish.gtm16

Enabling GTM integration in VWO

Now that you have configured GTM, you just need to enable GTM integration from the VWO Dashboard.

  • To enable integration for a new VWO test, you will first create the test and  then enable Google Tag Manager option in the last step of the creation process.gtm17
  • To enable integration for a specific test, select the test and go to the Summary page. Click Settings and select Others option. Then, select Google Tag Manager under Integrate With Third-Party Products.gtm18
  • To enable GA integration across all tests in your account, click the Settings icon on the upper right of the dashboard. Then select Campaign Settings, and enable Google Analytics in the Integrate With Third-Party Product.gtm19

Was this article helpful?

Thanks for your feedback!
Please email us at to tell us what you were looking for. We'll send the answer to your inbox.

Contact Us / Login