Google Analytics


To get a Google Analytics key for your site, go to "https://analytics.google.com". There, sign in with your Google ID and once signed in, you'll see this page.

Click on Admin.

Then, add a new property by clicking "Create property".

Then, give your website a name, add your URL, choose a category for your site and then click "Get Tracking ID".

Then, you'll see a Tracking ID for your site.

There are two ways to add it in the site:

Method 1:

You can either just copy the tracking code and go to "/panel/addons/customsnippets" and use that tracking code in the following snippet:

//Google Analytics
var script = document.createElement('script');
script.id = 'g-analytics';
script.src = 'https://www.googletagmanager.com/gtag/js?id=UA-XXXXXXXXX-X';
document.head.appendChild(script);

window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-XXXXXXXXX-X');


Method 2:

You can directly get the script tag from the Google Analytics page. To get that, click on "Tracking Code" and under Google Site Tag(gtag.js), you can see the <script></script> tag that you can use. But, you will only need what's inside the <script>...</script> tag. Normally, it looks like this:

  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'UA-XXXXXXXXX-X');

Note: We suggest you use Method 1 since it will load faster.

On the live marketplace, just in case you don't see the Google Analytics working, you would need to rebuild the site once you have added this script. For this, just go to "/panel/builder" and there, first click "Save settings" and then click "Rebuild site". It normally takes around 5 minutes to rebuild the site so you can see the changes.

builder