Website Building » Wix » Can I Add a Google Tag to My Wix Website?

Can I Add a Google Tag to My Wix Website?

Last updated on January 4, 2023 @ 11:17 pm

Google Tag Manager is a free tool that allows you to manage and deploy marketing tags (snippets of code used for tracking and analytics) on your website or mobile app without having to modify the code. Once you’ve added the Google Tag Manager code to your site, you can use the Tag Manager interface to add and update your tags.

What is a Google Tag?

GREAT NEWS:

Exciting update! We've collaborated with Wix to offer WBI users with a free plan for all website creation needs - Explore the details here.

A Google Tag is a snippet of code that allows you to track and analyze your website or mobile app’s traffic. Google Tags can be used for a variety of purposes, such as tracking pageviews, clicks, form submissions, and transactions. Adding a Google Tag to your website or app is quick and easy, and can be done without having to modify the code.

How do I add a Google Tag to my Wix website?

Adding a Google Tag to your Wix website is quick and easy. Simply follow these steps:

  1. Log in to your Wix account and select the site you want to edit.
  2. Click the gear icon in the top right-hand corner and select Site Manager.
  3. In the Site Manager, click Tracking & Analytics.
  4. Click +New Tool.
  5. Select “Custom” from the first drop-down menu.
  6. Enter the name of your tag in the “Name” field. This is for your own reference and will not be visible to visitors. For example, you might name it “Google Analytics”.
  7. “Paste your tag code”. In this field, paste the entire code snippet that you copied from Google Tag Manager.

For example:

<!-- 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=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXXX');</script>
<!-- End Google Tag Manager -->
  1. Click “Apply”.
  2. Your Google Tag will now be added to your Wix website.

Note: If you are using Google Tag Manager to manage your Google Analytics tracking code, you will need to remove the old Google Analytics code from your Wix site and replace it with the Google Tag Manager code. This will ensure that your Google Analytics tracking is properly integrated with Google Tag Manager.

Using Google Tag Manager can save you time and hassle by allowing you to manage and update your tags without having to modify the code of your website or app. Give it a try and see how it can streamline your tracking and analytics efforts.

Now that you’ve added the Google Tag Manager code to your site , you can use the Tag Manager interface to add and update your tags.

Here is the code snippet for the Global Site Tag (gtag.js) for Google Analytics:

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXXX-X"></script>
<script>
   window.dataLayer = window.dataLayer || [];
   function gtag(){dataLayer.push(arguments);}
   gtag('js', new Date());

   gtag('config', 'UA-XXXXXXXXX-X');
</script>

Replace “UA-XXXXXXXXX-X” with your own Google Analytics tracking ID. This code should be added to the <head> of your website’s HTML code.

Note that this code snippet is for the Global Site Tag (gtag.js) version of Google Analytics. If you are using the older analytics.js version, the code snippet will be slightly different. You can find more information on the different versions of Google Analytics tracking code here: https://developers.google.com/analytics/devguides/collection/gtagjs/migration

I hope this helps! Let me know if you have any further questions.

PRO TIP: Google tags are not compatible with Wix websites. If you try to add a Google tag to your Wix website, it will not work properly and could cause problems with your website.
Dale Leydon

Dale Leydon

Sysadmin turned Javascript developer. Owner of 20+ apps graveyard, and a couple of successful ones.