Skip to main content

Use the Google Tag Manager to Connect Your Site to the Site Audit

Written by Sidra Condron

How to Install the Site Audit Snippet with Google Tag Manager

To connect your site to SpyFu Site Audit, you add a small snippet to your site. Once it's installed and verified, SpyFu can publish the fixes you approve, such as updated titles and meta descriptions, and roll them back with one click.

If your site uses Google Tag Manager (GTM), GTM is the easiest place to add the snippet. This guide walks you through the whole process, plus what to do if you get stuck.


Before you start

You'll need:

  • Your Site Audit snippet. Find it in SpyFu under Site Audit → Settings → Publish Setup. Choose Google Tag Manager as your platform, then click Copy.

  • Access to your site's GTM container, with Publish permission. Step 2 shows you how to check.


Step 1: Find your GTM container ID

Your container ID starts with GTM- (for example, GTM-AB12CD3). To find the one your site uses:

  1. Open your website's homepage in Chrome.

  2. Right-click anywhere on the page and choose View page source (or press Ctrl+U, or Cmd+Option+U on a Mac).

  3. Press Ctrl+F (Cmd+F on a Mac) and search for gtm.js.

  4. Look in that same block of code for an ID starting with GTM-. That's your container ID.

Don't see gtm.js? Your site probably doesn't use Google Tag Manager. See If your site doesn't use Google Tag Manager below.

Tip: You may also see IDs starting with G- or AW-. Those are Google Analytics and Google Ads tags, not Tag Manager containers, and you can't add the snippet to them.


Step 2: Make sure you have access

  1. Go to tagmanager.google.com and sign in with your Google account.

  2. Click the Accounts tab. (Not "Google Tags." That area manages Analytics tags.)

  3. Look for the GTM- ID you found in Step 1.

Don't see it? Your Google account hasn't been added to that container yet. Only a container administrator can add you. Ask whoever manages your website or marketing tools. Here's a message you can send:

Can you add [your Google email] to GTM container GTM-XXXXXXX with Publish permission? I need to add a tag for SpyFu Site Audit.

Be sure to ask for Publish permission. With Edit permission alone, you can create the tag, but you can't make it live.


Step 3: Add the snippet as a tag

  1. Open your container.

  2. Click Tags in the left menu, then New.

  3. Click "Untitled Tag" at the top and rename it SpyFu Site Audit.

  4. Click Tag Configuration and choose Custom HTML.

  5. Paste your snippet into the HTML box. Don't change anything in it.

  6. Leave Support document.write unchecked.

  7. Click Triggering and choose All Pages.

  8. Click Save.


Step 4: Publish and verify

  1. Click Submit in the top right.

  2. Add a short note, such as "Added SpyFu Site Audit," and click Publish. Your tag isn't live until you publish.

  3. Go back to the SpyFu Publish Setup page and click Check installation.

  4. Wait for Verified live. You're all set!

Want to test first? Before you publish, click Preview in GTM and enter your site's address. If "SpyFu Site Audit" appears under Tags Fired, the tag is working.


Troubleshooting

I don't see my container in Tag Manager. Your Google account hasn't been added to it. Ask your container administrator to add you with Publish permission (see Step 2). If your company has more than one Google account, check that you're signed in with the right one. Click your profile picture in the top right of Tag Manager to see which account you're using.

I only see IDs that start with G-. Those are Google Analytics tags, not Tag Manager containers. Google has started listing them in Tag Manager, so they can look like containers. You need the GTM- container your site loads (see Step 1).

I can't publish. You have Edit permission, but not Publish. Ask your container administrator to upgrade your access to Publish.

I published, but it still won't verify. Check that:

  • The tag is in the same GTM- container your site loads (compare with Step 1).

  • The trigger is set to All Pages.

  • The snippet covers your whole domain. If part of your site runs on a separate platform, like a blog on a different CMS, that part may need the snippet added separately.

  • Your cookie consent banner or security settings aren't blocking scripts. If your site uses a Content Security Policy, allow spyfucdn.com.

I can't find the snippet in my page source. That's normal with Google Tag Manager. GTM adds the snippet after the page loads, so it won't appear in View page source. Use Check installation in SpyFu to confirm it's working.


Don't have access, or prefer someone else handle it?

On the SpyFu Publish Setup page, click Copy for my developer. It copies your snippet and these install steps into one message you can send to whoever manages your website by Slack, email, or ticket.


If your site doesn't use Google Tag Manager

You can add the snippet directly to your site instead. Paste it into your site-wide header, anywhere above the </head> tag. Many website platforms have a setting for this, often called Header code, Code injection, or Custom scripts. If you're not sure where yours is, use Copy for my developer to send the instructions to whoever manages your site.

Did this answer your question?