How to set up Google Tag Manager on a Wix site

Author:

Setting up Google Tag Manager (GTM) on a Wix site can be a bit more challenging than on other platforms, but it’s still a great way to manage your website’s tags and track your online activities. In this comprehensive guide, we’ll walk you through the process of setting up Google Tag Manager on a Wix site.

Prerequisites.

  1.  You have a Google Analytics account.
  2.  You have a Google Tag Manager account.

 1. Prepare Your Wix Site

Before setting up GTM, make sure your Wix site is configured to allow third-party scripts. To do this:

  1. Log in to your Wix account and go to the “Settings” icon () in the top navigation menu.
  2. . Click on “Site Settings” and then scroll down to the “Advanced” section.
  3.  Look for the “Third-Party Scripts” option and toggle it to “On”.

 2. Create a New Container in Google Tag Manager

In GTM, a container is a virtual representation of your website. To create a new container:

  1. Log in to your Google Tag Manager account.
  2. Click on “Admin” in the top navigation menu.
  3.  Click on “Create Container” and select “Web” as the container type.
  4. Enter your website’s URL and choose a container name (e.g., “Wix Site”).
  5. Click “Create” to create the container.

 3. Get Your GTM Container ID

Once your container is created, you’ll need to get the container ID. To do this:

  1. Go back to your GTM account and click on the container you just created.
  2. Click on the three vertical dots next to the container name and select “Copy” > “Copy Container ID”.
  3. Note down the container ID; you’ll need it later.

 4. Add the GTM Tracking Code to Your Wix Site

To add the GTM tracking code to your Wix site:

  1. Go back to your Wix dashboard and click on “Settings” ().
  2.  Click on “Site Settings” and then scroll down to the “Advanced” section.
  3.  Look for the “Head” section and click on the “+” icon to add a new head tag.
  4. Paste the following code into the head tag:
    “`html
    <!– Google Tag Manager –>
    <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({‘gtm.start’:
    new Date().getTime(),event:’gtm.js’});var f=w[d];w[d]=w[d]||[];w[d].push({‘gtm.start’:
    new Date().getTime(),event:’gtm.load’});s.appendChild(w[l]);})(window,document,’script’,’dataLayer’,’GTM-<container-id>’);</script>
    “`
    Replace `<container-id>` with the container ID you copied earlier.

 5. Verify Your GTM Installation

To verify that GTM is installed correctly:

  1.  Go back to your GTM account and click on the container you created.
  2. Click on the three vertical dots next to the container name and select “Verify”.
  3.  Follow the instructions to verify your installation by clicking on a verification link or uploading a small HTML file.

 6. Configure Your GTM Tags

Now that GTM is installed, you can start creating tags to track various events on your website. Here are some common tags you might want to set up:

  • Page View: Track page views by creating a page view tag in GTM.
  • Event: Track button clicks, form submissions, or other custom events by creating an event tag in GTM.
  • Google Analytics: Connect your Google Analytics account to GTM by creating an analytics tag.

Tips and Tricks:

  • Make sure to use the correct container ID in your GTM tracking code.
  •  Use Wix’s built-in page view tag or create a custom tag using their API if needed.
  •  Use GTM’s built-in triggers (e.g., page view, scroll) or create custom triggers using JavaScript.
  •  Use GTM’s built-in variables (e.g., {{Page Path}}) or create custom variables using JavaScript.

Troubleshooting Tips:

  •  Check your browser console for any errors related to GTM installation or execution.
  • Verify that your GTM tracking code is loaded correctly by checking the source code of your Wix site.
  • Check that your tags are firing correctly by using GTM’s debug mode or testing tools.

By following these steps, you should be able to successfully set up Google Tag Manager on your Wix site. Remember to verify your installation, configure your tags, and troubleshoot any issues that may arise.