Configure Tag Manager to use protocol-relative URLs
Stay organized with collections
Save and categorize content based on your preferences.
To help secure tag data, the Google Tag Manager container tag uses HTTPS to
load resources (i.e. https://www.googletagmanager.com).
If you need to load your Tag Manager containers in a protocol-relative manner,
you may do so by adjusting the protocol in your container code to be //
instead of https://.
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXX');</script>
<!-- End Google Tag Manager -->
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-XXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
When you use a protocol-relative URL, the container is loaded via HTTP on pages
that use http://, and via HTTPS on pages that use https://.
Older versions of the Tag Manager container code used a
protocol-relative URL to load containers (i.e., //www.googletagmanager.com).
These older protocol-relative versions of the Tag Manager container
code will continue to work.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-09 UTC."],[[["Google Tag Manager container tag uses HTTPS by default for enhanced security."],["You can switch to a protocol-relative URL (//) for flexible loading based on the page's protocol (HTTP or HTTPS)."],["Existing protocol-relative implementations of Tag Manager containers will continue to function."],["Ensure custom tags on secure pages are set up with protocol-relative or secure URLs for consistent security."]]],[]]