Technical
Tracking code
Also called tag snippet.
Tracking code is the snippet pasted into a site that loads the measurement script and names the property it reports to. A pixel version does the same job with an image request.
How it is measured
View source and find the snippet, usually in the head: a script tag with a site id or an inline loader. Use the vendor's checker or the Network panel to confirm it fires exactly once per page load with the right id.
Crawl every template for the snippet and count pages with the code against total pages. The gaps are usually the 404 page, checkout, and landing templates.
Worked example
A WordPress site installs the code through a plugin and also hard-codes it in `header.php`. Pageviews look doubled, and the Network panel shows two collect POSTs per load. Removing the hard-coded copy brings the weekly count from 22,400 back to 11,200.
A custom landing template that omits `wp_head()` shows no data at all for its 30 pages until the snippet is added there by hand.
How it differs
A tracking code is the snippet you install on a page. A JavaScript tag is the script it loads, and that script does the measuring. The code is what you paste and the tag is what runs.
Common errors
Installing it twice. Missing templates such as the 404 page, checkout, and landing pages. Copying the wrong property id. Placing it in the footer so quick exits are missed. Leaving a staging id on production. Forgetting subdomains.
In practice
Crawl your site and count pages with exactly one snippet. Compare the site id on each. Keep a note of where it lives, theme, plugin, or tag manager, so no one adds it a second time.