# Install ClickGuard's tracking code

The ClickGuard tracking code goes on every page of your website, so ClickGuard sees each visit from your ads. ClickGuard can install it for you with Google Tag Manager while you set up your website's protection, or you can install it yourself: manually, on Shopify, on Wix or in Google Tag Manager.

Source: https://www.clickguard.com/help/getting-started/install-clickguards-tracking-code
Published: 2026-10-05
Updated: 2026-10-05
Author: Nikola Pejic

The ClickGuard tracking code goes on every page of your website, so ClickGuard sees each visit from your ads. The easiest way to install it is to let ClickGuard do it for you with Google Tag Manager while you set up your website's protection.

## Let ClickGuard install it with Google Tag Manager

When you reach the tracking code step while configuring your website's protection:

1.  Select **Install with Google Tag Manager**.
    
2.  Under **Authorized with**, select a credential that has access to the Google Tag Manager account you want to use. If you don't have one yet, click **New authorization**.
    
3.  Select the **GTM Account**, the **Container** and the **Workspace**.
    
4.  Click **Install Tracking Code**.
    

ClickGuard creates a new tag with your tracking code and publishes it to the workspace you selected, so there's nothing else to do. If someone else manages your Google Tag Manager, click **Invite a team member to complete this step**.

If you prefer to install the code yourself, pick the option below that fits how your site is managed.

## Install it manually

Follow the steps below to install the tracking code properly:

### Step 1: Copy your unique tracking code

1.  Log in to your ClickGuard account.
    
2.  Navigate to **Settings** › **Tracking code** › **Standard tracking**.
    
3.  Select **Install manually**.
    
4.  Copy the provided JavaScript tracking snippet. This code is _unique_ to your account and website.
    

![Tracking code manual installation page](/docs-media/tracking-code-install-manually.png)

### Step 2: Add the code to your website

The tracking code must be placed immediately before the closing `</head>` tag on every page where you wish to track activity.

**Static HTML websites**

Paste the tracking code into the `<head>` section of each HTML file.

```
<head>
  <!-- Other head elements -->
  <script>/* Your ClickGuard tracking code */</script>
</head>
```

**CMS-based websites (e.g., WordPress)**

-   Access your theme settings or install a plugin that supports custom script injection into the `<head>`.
    
-   Paste the tracking code and save your changes.
    

## Install it on Shopify

On Shopify, the tracking code goes in your store's theme. Log in to your Shopify store and follow these steps.

**Note:** ClickGuard can't track visitor behavior on Shopify's checkout page. If you're on Shopify Plus, ask your Merchant Success Manager how to add the code to checkout too.

### Step 1: Open your online store

In your Shopify dashboard, click **Online Store**.

![Online Store in the Shopify dashboard](/docs-media/file-1776234339686.png)

### Step 2: Edit your theme's code

Click **Themes**, then the **Actions** button at the top right, and choose **Edit code**.

![Edit code in the theme actions](/docs-media/file-1776234340007.png)

### Step 3: Find the closing body tag

Under **Layout**, select **theme.liquid** and scroll down until you find the closing `</body>` tag.

![The closing body tag in theme.liquid](/docs-media/file-1776234340476.png)

### Step 4: Paste the tracking code

Paste your ClickGuard tracking code just before the closing `</body>` tag. You can copy it from **Settings** › **Website** › **Tracking code**.

### Step 5: Save and publish

Click **Save**, then publish your theme to apply the change.

## Install it on Wix

**Note:** this works only for Wix sites with a connected domain.

### Step 1: Go to Settings

Open **Settings** in your Wix site's dashboard.

### Step 2: Open Tracking & Analytics

Under **Advanced Settings**, click the **Tracking & Analytics** tab.

### Step 3: Add a custom tool

Click **\+ New Tool** and select **Custom** from the dropdown.

### Step 4: Paste the tracking code

Paste your ClickGuard tracking code into the box. You can copy it from **Settings** › **Website** › **Tracking code**.

### Step 5: Select the domain

Select the domain you're adding the code to. This option only appears if you have more than one domain.

### Step 6: Name the code

Give it a name you'll recognise, for example “ClickGuard”.

### Step 7: Load it on all pages

Select **All Pages** so ClickGuard can track visitor behavior across your site, and choose **Load code once**. Under **Place Code in**, select **Body - end**.

### Step 8: Save your changes

Click **Apply**. ClickGuard can now track visitor behavior on your Wix site.

## Install it with Google Tag Manager yourself

If you're using **Google Tag Manager (GTM)** to manage website scripts, you can easily install the ClickGuard tracking code without touching your site's source code directly. Follow the steps below to complete the setup.

### Step 1: Create a new tag in Google Tag Manager

1.  Open your [Google Tag Manager account](https://tagmanager.google.com/).
    
2.  Select the appropriate container for your website.
    
3.  Click on **Tags** in the left-hand menu, then click **New Tag**.
    
4.  Name your tag (e.g., _ClickGuard Tracking_).
    

### Step 2: Copy your ClickGuard tracking code

1.  Log in to your [ClickGuard Account dashboard](https://app.clickguard.com/).
    
2.  Navigate to **Settings** › **Tracking code** › **Standard tracking**.
    
3.  Copy the full JavaScript tracking snippet provided for your account.
    

### Step 3: Configure the tag

1.  Click **Tag Configuration**.
    
2.  Choose **Custom HTML** as the tag type.
    
3.  Paste the ClickGuard tracking code into the HTML field.
    

### Step 4: Set the trigger

1.  Click **Triggering**.
    
2.  Select the trigger type: **All Pages** – this ensures the tracking code loads on every page of your website.
    

### Step 5: Save and publish

-   Click **Save** to finish creating the tag.
    
-   Click **Submit** in the top-right corner of GTM.
    
-   Add a version name (e.g., _ClickGuard Installation_) and click **Publish**.
    

Your ClickGuard tracking code is now active via Google Tag Manager. ClickGuard will begin monitoring visitor sessions and protecting your ad campaigns immediately.

## Verify the installation

Once the code has been added:

1.  Visit your website and navigate through several pages.
    
2.  Return to your ClickGuard dashboard.
    
3.  Go to **Clicks** › **Live monitoring** › **Organic traffic** to confirm that organic clicks are being tracked.
    

![Click Forensics page](/docs-media/file-1790755221245.png)

If no data appears after a few minutes, verify that the script is correctly placed and is not being blocked by browser extensions or cookie consent settings.

> **Important:** add the tracking code to your website's global layout or template so it loads on every page. That way no visit goes unrecorded.

Once installed, ClickGuard will begin analyzing and protecting your traffic in real time. If you encounter any issues during installation, please contact [ClickGuard support](https://www.clickguard.com/contact-us).

See also: [Check tracking code installation](https://www.clickguard.com/help/troubleshooting/check-tracking-code-installation).

## Related articles

- [Check tracking code installation](https://www.clickguard.com/help/troubleshooting/check-tracking-code-installation.md)
