DocsGoogle AnalyticsSet upTracking code

Add GA4 Tracking Code

For Google Analytics to receive your traffic data, you need to add a tracking code to your website. This page will help you achieve this. It assumes that you have already configured Google Analytics correctly and that you have a working website.

Get your Google Analytics tracking ID

The first thing to do is to get your tracking ID, or measurement ID, which enables Google Analytics to identify the website from which the data it receives originates. This ID is actually different from your property ID, and begins with G-. To find it, follow the steps below.

List web data streams

Copy web data stream ID

Add the tracking code to your website

Once you have your ID, you have several options. Either you’re using a no-code platform, such as Wordpress. In this case, it’s likely that a Google Analytics integration already exists, and you just need to provide it with this ID. Or you’re not, and you’ll need to manually add the tracking script. Choose the option that applies best to you.

No-code integrations

No documentation available yet.

Tracking code (manual option)

If you’re not using a no-code platform, you’ll need to add the tracking code manually. Here’s how to do it.

  1. Copy the following code snippet.
  2. Replace G-XXXXXXXXXX with your tracking ID (caution: it appears twice).
  3. Paste it into the <head> section of your website, just before the closing </head> tag. It must be present on all pages of your website.
<!-- Google tag (gtag.js) -->
<script
  async
  src="https://www.googletagmanager.com/gtag/js?id=G-XXXXXXXXXX"
></script>
<script>
  window.dataLayer = window.dataLayer || []
  function gtag() {
    dataLayer.push(arguments)
  }
  gtag('js', new Date())
 
  gtag('config', 'G-XXXXXXXXXX')
</script>

Once done, check that Google Analytics is receiving data.