Setting Up Google Analytics Using Google Tag Manager

3 min read
With Google Tag Manager, you can implement a tag management system so you can keep your tags and third-party code snippets updated and organized in one convenient location.
You can connect your site to Google Tag Manager in Marketing Integrations to start tracking visitor events on your site.
Wix ensures a pageview event is sent to the Google Tag Manager data layer every time a user visits a new page on your site. Follow the steps below to set up a Google Tag Manager tag to collect pageviews.
By using this service, you are engaging directly with a third-party service provider. We recommend reviewing the service provider's Privacy Policy and Terms of Use prior to your use of such third-party service. You acknowledge that we are not liable for any loss or damage resulting from your use of such third-party service, including any liability arising from any personal data exchanged between you and such third-party.

Step 1 | Create a trigger for pageview events

First, you'll need to set up a trigger for your pageview events in your Google Tag Manager account. 

To set up your trigger:

  1. Sign in to your Google Tag Manager account.
  2. Click Triggers in the menu on the left.                  
  3. Click New
  4. Click Choose a trigger type to begin setup
  5. From the list of trigger types, select Custom Event.
  6. Type "Pageview" under Event name.
  7. Click Save.
  8. Enter a name for your trigger (e.g. Wix Pageviews).

Step 2 | Create a variable to hold the page URL

After you've created your trigger, you'll need need to create a new variable in Google Tag Manager that you can connect the trigger to.

To create a variable:

  1. Click Variables from the left hand side menu.
  2. Click New under User-Defined Variables.
  3. Click Choose a variable type to begin setup
  4. Select Data Layer Variable from the list of possible trigger types.
  5. Type "url" under Data Layer Variable Name.
  6. Click Save.
  7. Enter a name for your variable. (e.g. Wix var - page url)

Step 3 | Set up your tag for Google Analytics

The last step is to set up a tag for Google Analytics that uses your new variable name. 

To set up your tag:

  1. Click Tags from the left hand side menu.
  2. Click New.
  3. Enter a name for the tag (e.g. Wix Pageviews).
  4. Click Choose a tag type to begin setup under Tag Configuration
  5. Select Google Analytics: Universal Analytics from the list.
  6. Select Enable overriding setting in this tag.
  7. Enter your Google Analytics property's Tracking ID under Tracking ID. 
  8. Click More Settings.
  9. Click Fields to Set.
  10. Click + Add Field.
  11. Enter "page" under Field Name.
  12. Add your variable name inside double curly brackets under Value. For example, {{Wix var - page url}}.
  1. Click Choose a trigger to make this tag fire under Triggering.
  2. Select the trigger that you created in Step 1.
  3. Click Save.

Important information about using Google Tag Manager

  • This feature is only available for sites with a connected domain
  • It is not possible to track events for business solutions pages (e.g. Wix Restaurants, Wix Bookings, etc.)
  • If you've previously set up a preset tracking code using Google Tag Manager (e.g. a Facebook pixel), you must disable the tracking code in your Wix account. Running the same code in Google Tag Manager and on your Wix site may cause the code to misreport or malfunction. 
  • Wix does not provide support for technical issues with third-party code snippets. If you have an issue with your code snippet, please contact the provider directly.

Did this help?