Adding Google Tag Manager (GTM) to your ASP website allows you to manage all tracking and marketing tags in one place. This is particularly important for complying with Google Consent Mode 2.0 and keeping your analytics setup clean and flexible.
This step-by-step guide walks you through checking for existing tags and safely installing GTM on your ASP-powered website.
Related Reading:
Step 1: Check If GTM Is Already Installed
Before installing GTM, it's essential to check your site for existing tags. Installing GTM twice can lead to data duplication or tracking issues.
How to check:
-
Install the Tag Assistant Chrome Extension:
Tag Assistant – Chrome Web Store -
Visit your website and click the Tag Assistant icon in your browser.
-
Tag Assistant will show a list of all active tracking tags, including:
-
Google Tag Manager (GTM)
-
GA4
-
Google Ads
-
Meta Pixel, and others
-
📷 Screenshot example:
Important: If GTM is already installed, do not proceed. Speak to your analytics team or developer first to avoid conflicting installations.
If you see other hardcoded marketing tags, consider migrating them into GTM for better control and Consent Mode compliance.
See: Understanding Cookie Compliance: Why It Matters & How It Affects Your Data
Step 2: Get Your GTM Code Snippets
-
Log in at tagmanager.google.com
-
Select your GTM container (or create a new one).
-
Click Admin > Install Google Tag Manager
-
You’ll be given two code snippets:
-
One for the
<head>section -
One for immediately after the opening
<body>tag
-
Copy and save both snippets for the next step.
📷 Screenshot example:
Step 3: Add the GTM Code to Your ASP Website
Use ASP’s built-in Third-Party Code tool to insert the GTM snippets.
Add the first snippet (to the <head> section):
-
Log in to your ASP CMS.
-
Go to:
Settings > Site Settings > Third Party Code -
Click Add Third Party Code and fill in the fields:
| Field | Value |
|---|---|
| Title | Your GTM Reference: GTM-WHH2CCBL
|
| Third-party Code | Paste the first snippet here |
| Code Description | Google Tag Manager |
| Category | Analytics |
| Location | Before head end |
| Content | This third-party code is not restricted |
-
Click Save.
📷 Screenshot example:
Add the second snippet (to the <body> section):
-
Click Add Third Party Code again.
-
Use the following values:
| Field | Value |
|---|---|
| Title | Your GTM Reference: GTM-WHH2CCBL
|
| Third-party Code | Paste the second snippet here |
| Code Description | Google Tag Manager |
| Category | Analytics |
| Location | After body start |
| Content | This third-party code is not restricted |
-
Click Save.
Step 4: Confirm GTM Is Installed Correctly
Once installed, go back to your GTM container to test it.
-
In GTM, click Preview
-
Enter your website URL and click Connect
-
Your website will open in a new tab
-
Return to Tag Assistant and confirm that GTM is firing as expected
📷 Screenshot example:
You're All Set
Your ASP website is now running Google Tag Manager. You can now use GTM to add tracking tags like:
-
Google Analytics 4
-
Meta Pixel
-
LinkedIn Insight Tag
-
Google Ads Conversion Tracking …and many more, all in one place.
This approach is essential for maintaining compliance with cookie consent rules and improving tag performance.
Comments
0 comments
Please sign in to leave a comment.