Install guide · tag-manager · ~4 min

Install Admaxxer on Google Tag Manager

Custom HTML tag on All Pages.

GTM is a great option when you cannot edit the site head directly. Create a Custom HTML tag that wraps the Admaxxer snippet and fire it on the built-in All Pages trigger.

Steps

  1. 1 Open your GTM container

    In tagmanager.google.com, open the container installed on your site.

  2. 2 Create a Custom HTML tag

    Go to Tags → New. Name it "Admaxxer Pixel". Tag Configuration → Custom HTML. Paste the snippet below.

    html
    <script defer
      data-website-id="YOUR_WEBSITE_ID"
      data-domain="yourdomain.com"
      src="https://admaxxer.com/js/script.js"></script>
  3. 3 Set the trigger

    Trigger → All Pages (the built-in trigger that fires on every pageview). Save the tag.

  4. 4 Publish the container

    Click SubmitPublish. The tag is live immediately on sites running your GTM snippet.

  5. 5 Verify the install

    Load any public page on your site in a fresh browser tab. Within a few seconds, the Admaxxer dashboard realtime view should show the event. If nothing lands after 2 minutes, re-check the snippet is actually in the rendered HTML <head> (View Source, not just DevTools).

Verify installation

Troubleshooting

The tag fires (Preview shows green) but no events reach Admaxxer.
Cause: GTM's Custom HTML tag executes inside an injected <iframe>-like sandbox that respects your site's Content-Security-Policy. If your CSP's script-src directive does not allow https://admaxxer.com, GTM still reports the tag as "fired" (it ran the parser) but the browser refuses to execute the loaded script. Symptoms: DevTools Console shows "Refused to load the script ‘https://admaxxer.com/js/script.js’…" while GTM Preview claims success. Fix: add https://admaxxer.com to your CSP's script-src AND connect-src directives. See /documentation/troubleshoot/csp for canonical CSP snippets.
GTM strips my <code>data-website-id</code> attribute.
Cause: GTM Custom HTML tags run their HTML through a sanitizer when Support document.write is OFF (the default in newer GTM accounts). The sanitizer treats unknown data-* attributes inconsistently — some accounts strip them, others preserve them. When data-website-id is dropped, the pixel loads but cannot identify the site, so events go nowhere. Fix (recommended): replace the static <script> tag with a JS adapter that builds the element programmatically (the sanitizer leaves dynamically-set dataset properties alone):
<script>
(function() {
  var s = document.createElement('script');
  s.defer = true;
  s.dataset.websiteId = 'admx_YOUR_WEBSITE_ID';
  s.src = 'https://admaxxer.com/js/script.js';
  document.head.appendChild(s);
})();
</script>
This is the sister of the Shopify Custom Pixel snippet pattern (GL#305) — but inverted: GTM's sandbox does have a real document object, unlike Shopify's pure Web Worker. Fix (alternative): toggle Support document.write ON in the tag's Advanced Settings — this disables the sanitizer but is treated as a security regression by some GTM admins.
Tag fires twice on every page.
Cause: the same tag is wired to both All Pages and DOM Ready triggers, OR the GTM container snippet is pasted twice in the host HTML (common when a CMS plugin and a manual paste coexist). Fix: in GTM, edit the tag and confirm it has exactly ONE trigger (All Pages); on the host site, View Source and confirm googletagmanager.com/gtm.js appears exactly once. The pixel is idempotent (data-admaxxer-loaded guard) so a double-fire does not corrupt analytics, but it does double-bill GTM tag invocations.
Preview mode works but published container does not fire.
Cause: you saved the workspace but did not click Submit → Publish. GTM containers are versioned — the live tag is whichever version was last published. Fix: click Submit at the top of the GTM admin, write a one-line version note, click Publish. The new version goes live within ~5 seconds.
No events are showing up. What now?
Open DevTools Console and Network. Filter for script.js and /api/event. If they are blocked:csp, your Content Security Policy is blocking admaxxer.com — see /documentation/troubleshoot/csp. Also double-check that data-website-id matches the ID shown in your dashboard.
Events show up in staging but not production.
Confirm data-domain matches the production hostname exactly (no protocol, no trailing slash). Also confirm the website's Allowed Domains list in settings includes the prod domain.
My site is a single-page app — am I missing pageviews?
Use script.hash.js if you rely on location.hash routing. Otherwise the default script.js already hooks history.pushState/replaceState and tracks SPA navigations.