[{"data":1,"prerenderedAt":368},["ShallowReactive",2],{"docs-\u002Fscan-modes\u002F":3},{"id":4,"title":5,"body":6,"breadcrumb":328,"coderail":335,"dateModified":357,"datePublished":357,"description":358,"extension":359,"meta":360,"navigation":361,"next":357,"path":362,"prev":357,"schemaType":363,"seo":364,"stem":365,"wide":366,"__hash__":367},"docs\u002Fscan-modes.md","Scan modes",{"type":7,"value":8,"toc":315},"minimark",[9,27,31,50,73,97,107,111,118,133,136,140,145,148,152,158,200,204,219,234,246,249,260,264,270,284,288,305],[10,11,12,13,17,18,21,22,26],"p",{},"TagManifest supports two input modes for container analysis. The ",[14,15,16],"strong",{},"JSON export scan"," accepts a GTM container export, sent as it was downloaded. The ",[14,19,20],{},"public scan"," fetches and parses the live ",[23,24,25],"code",{},"gtm.js"," file served by the Google Tag Manager CDN. Both modes run the same rule engine, but they have different visibility into the container. Some rules require the richer data available only in an export.",[28,29,16],"h2",{"id":30},"json-export",[10,32,33,34,37,38,41,42,45,46,49],{},"The JSON export scan takes a container in the ",[23,35,36],{},"data"," field of a ",[23,39,40],{},"POST \u002Fv1\u002Fscan"," request. Export the container from the GTM admin interface (",[14,43,44],{},"Admin → Export container",") and send the file's JSON as it is. The API recognises an export by its ",[23,47,48],{},"containerVersion"," key and parses it for you.",[10,51,52,54,55,58,59,62,63,66,67,72],{},[23,53,36],{}," also accepts a container that TagManifest has already parsed: an object with ",[23,56,57],{},"tags",", ",[23,60,61],{},"triggers"," and ",[23,64,65],{},"variables"," arrays. Anything else is refused with a 400. See ",[68,69,71],"a",{"href":70},"\u002Fapi\u002Fscan\u002F","POST \u002Fscan"," for the exact checks.",[10,74,75,76,79,80,82,83,86,87,89,90,92,93,96],{},"The export format includes the complete container definition as Google stores it: full tag parameter sets, trigger configurations, variable values, folder assignments, workspace metadata, and a ",[23,77,78],{},"fingerprint"," on the tags, triggers and variables that GTM stamped with one. TagManifest reads each ",[23,81,78],{}," as a date, the ",[23,84,85],{},"fingerprintDate",", which records when the entity was last modified. An entity with no ",[23,88,78],{}," gets a ",[23,91,85],{}," of ",[23,94,95],{},"null",". Rules that detect staleness depend on this date.",[10,98,99,100,102,103,106],{},"The export also includes data that the public ",[23,101,25],{}," file leaves out, such as workspace-specific settings and folder structure. The ",[23,104,105],{},"referencedByTags"," cross-reference, which links triggers and variables to the tags that use them, is in neither file. TagManifest builds it from the tags in both modes.",[28,108,110],{"id":109},"public-scan","Public gtm.js scan",[10,112,113,114,117],{},"The public scan fetches ",[23,115,116],{},"https:\u002F\u002Fwww.googletagmanager.com\u002Fgtm.js?id=\u003CGTM-ID>",", parses the minified JavaScript, and reconstructs a container-like object from it. This requires no GTM account access — any published container is scannable.",[10,119,120,121,124,125,128,129,132],{},"Pass either a ",[23,122,123],{},"gtm_id"," directly, or a ",[23,126,127],{},"url",". When you pass a URL, the API fetches the page HTML and takes the first GTM container ID it finds there. That is the only use made of the page: the audit runs on the container, not on the page. The page fetch gives up after 8 seconds per request, follows at most 3 redirects, and reads at most 5 MB. Both inputs go to ",[23,130,131],{},"POST \u002Fv1\u002Fscan-url",".",[10,134,135],{},"The public scan covers all tags, triggers, and variables that appear in the published container version.",[28,137,139],{"id":138},"what-each-misses","What each misses",[141,142,144],"h3",{"id":143},"json-export-what-it-cannot-see","JSON export — what it cannot see",[10,146,147],{},"The export reflects the container at the time of export, not the live state of the page. If the export is from an unpublished workspace, it represents a draft state that may not match what visitors see. The API does not check the export against the page it runs on, such as other scripts on the page or a consent banner loaded outside GTM.",[141,149,151],{"id":150},"public-scan-what-it-cannot-see","Public scan — what it cannot see",[10,153,154,155,157],{},"The CDN-served ",[23,156,25],{}," file is a compiled representation of the published container. Several data types are absent or degraded:",[159,160,161,176,186,194],"ul",{},[162,163,164,168,169,171,172,175],"li",{},[14,165,166,132],{},[23,167,85],{}," The public file carries no fingerprints, so every tag, trigger and variable has a null ",[23,170,85],{}," on a public scan. ",[23,173,174],{},"stale-paused-tags"," needs the date to work out how long a tag has been paused. It skips tags without one, so it returns no finding on a public scan. It can fire only on a JSON export scan.",[162,177,178,181,182,185],{},[14,179,180],{},"Folder structure."," The public file carries no folders. ",[23,183,184],{},"tags-no-folder"," skips public scans and returns no finding there.",[162,187,188,193],{},[14,189,190,192],{},[23,191,105],{}," resolution."," Neither file carries this cross-reference. Both parsers build it from each tag's triggers and variable references. The public parser works from the compiled file, which may miss edge cases in complex sequencing chains.",[162,195,196,199],{},[14,197,198],{},"Workspace metadata."," Draft workspaces, submission state, and user annotations are not present in the public bundle.",[28,201,203],{"id":202},"layer-aware-rules","Rule layers",[10,205,206,207,210,211,214,215,218],{},"Each rule in ",[23,208,209],{},"GET \u002Fv1\u002Frules"," has a ",[23,212,213],{},"layer_requirements"," field, a string that names the data the rule needs. Every shipped rule has the value ",[23,216,217],{},"container",": it needs only the container, so it runs in both scan modes.",[10,220,221,222,225,226,229,230,233],{},"One rule in the catalog, ",[23,223,224],{},"consent-page-cmp-not-enforcing",", has the value ",[23,227,228],{},"container+page",". Its status is ",[23,231,232],{},"deferred",". It does not run through the API or the MCP server.",[10,235,236,237,62,240,242,243,245],{},"The API and the MCP server run no page checks. ",[23,238,239],{},"scan_url",[23,241,131],{}," read the page HTML only to find the GTM container ID, then audit that container. When you pass a ",[23,244,123],{},", no page is fetched at all.",[10,247,248],{},"The web scanner at tagmanifest.com adds its own page checks on top of the container audit. Those checks are not part of the API or MCP results.",[10,250,251,252,254,255,257,258,132],{},"A rule that needs data the public ",[23,253,25],{}," file lacks returns no finding. It does not guess. ",[23,256,174],{}," is the example: it skips any paused tag that has no ",[23,259,85],{},[28,261,263],{"id":262},"choosing","Choosing a mode",[10,265,266,267,269],{},"Use the ",[14,268,20],{}," when:",[159,271,272,275,278,281],{},[162,273,274],{},"You want to audit a site without GTM account access.",[162,276,277],{},"You are running automated checks in CI against a deployed URL.",[162,279,280],{},"You need results in a single API call with no file handling.",[162,282,283],{},"You want to audit a container on a site you do not own.",[10,285,266,286,269],{},[14,287,16],{},[159,289,290,293,296,299],{},[162,291,292],{},"You need complete coverage, including staleness detection and folder structure.",[162,294,295],{},"You are auditing a container before publishing (draft state).",[162,297,298],{},"You need to audit a private or internal container not reachable over the public web.",[162,300,301,302,304],{},"You need ",[23,303,174],{}," to fire.",[10,306,307,308,310,311,314],{},"Both modes return the same findings shape and the same health score structure. A ",[23,309,131],{}," response also has a ",[23,312,313],{},"site"," object with the URL, the GTM ID and the cache state.",{"title":316,"searchDepth":317,"depth":317,"links":318},"",2,[319,320,321,326,327],{"id":30,"depth":317,"text":16},{"id":109,"depth":317,"text":110},{"id":138,"depth":317,"text":139,"children":322},[323,325],{"id":143,"depth":324,"text":144},3,{"id":150,"depth":324,"text":151},{"id":202,"depth":317,"text":203},{"id":262,"depth":317,"text":263},[329,332,334],{"label":330,"href":331},"API Reference","\u002F",{"label":333},"Concepts",{"label":5},{"cards":336,"onpage":351},[337,343],{"title":16,"tabs":338},[339],{"label":340,"language":341,"code":342},"cURL","bash","# Export your container from GTM → Admin → Export container.\n# Send the export file as it is in the \"data\" field.\n\ncurl https:\u002F\u002Fdeveloper.tagmanifest.com\u002Fv1\u002Fscan \\\n  -H \"Authorization: Bearer $TM_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d \"{\\\"data\\\": $(cat container-export.json)}\"\n",{"title":344,"tabs":345},"Public URL scan",[346,348],{"label":340,"language":341,"code":347},"curl https:\u002F\u002Fdeveloper.tagmanifest.com\u002Fv1\u002Fscan-url \\\n  -H \"Authorization: Bearer $TM_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"url\": \"https:\u002F\u002Fexample.com\"}'\n",{"label":349,"language":341,"code":350},"Direct GTM ID","curl https:\u002F\u002Fdeveloper.tagmanifest.com\u002Fv1\u002Fscan-url \\\n  -H \"Authorization: Bearer $TM_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\"gtm_id\": \"GTM-EXAMPLE\"}'\n",[352,353,354,355,356],{"id":30,"label":16},{"id":109,"label":110},{"id":138,"label":139},{"id":202,"label":203},{"id":262,"label":263},null,"Two scan modes: JSON export upload and public gtm.js scan. What each captures, what each misses, and when to use which.","md",{},true,"\u002Fscan-modes","TechArticle",{"title":5,"description":358},"scan-modes",false,"iNg8QgH3qZrtySDGtPkfrbITYDYlWP2DHrGESMgzrf0",1796069482580]