Should I load analytics through a tag manager or a plain script tag?

Use the plain script tag unless a tag manager already runs on the site and someone adds tags there without a deploy. PostDeploy Analytics is one tag with a single setting, its data-site attribute, so a tag manager has nothing to configure for it and adds a second script that must load before any visit counts.

Last updated 26 November 2026. By Paul Badarau.

A fictional agency looks after a client's marketing site. The client's marketer adds and removes tags in a tag manager every few weeks, and the agency deploys code once a month. Here the tag manager is the better place for the snippet, because the marketer can see every tag in one place. On the agency's own portfolio, which only the agency edits, the plain tag in the template is simpler.

Use the plain tag when you edit and deploy the template yourself, when the site has few other tags, or when you want the fewest moving parts between a page load and a counted pageview. Use a tag manager when it already loads the other tags, or when someone without access to the code manages tags.

The setup in PostDeploy Analytics gives you the plain tag and does not document a tag manager setup, so the collection check is your test. If you go through a tag manager:

  1. Create a custom HTML tag with the exact snippet from the Project's tracking setup, and fire it once on every page load.
  2. Do not fire it again on history changes. The script already sends a pageview on each single-page navigation, and a second copy doubles every pageview.
  3. Publish, then run the collection check. The script reads its Project id from the data-site attribute on its own tag, so if the tag manager drops or rewrites that attribute, nothing is counted.
  4. Goal calls from tag manager triggers work once the script has loaded. Guard each one: if (window.postdeploy) postdeploy.track("signup");

A tag manager makes Analytics depend on it. When a content blocker stops the tag manager, or a consent tool inside it holds tags until a visitor agrees, Analytics counts none of those visitors, even though its own script sets no cookies. Whether your site needs consent at all depends on everything else on it and where you operate. This is not legal advice.

The product page for this is Analytics.

Start your 14-day free trial