Allow having secondary Tag Manager container if site uses paired AMP #413
Comments
|
Thanks for the detailed report @kmwilkerson! Since you reported multiple issues, we split these into a few:
I hope that addresses the problems! |
|
IB @aaemnnosttv Just to clarify, in settings the containers that are displayed should also depend on the AMP mode. E.g. an AMP container should only be shown if primary or secondary AMP, a non-AMP container should only be shown if secondary AMP or no AMP. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment




Note: The original report below includes multiple issues, but let's use this issue only to track "Issue 1" below.
Related resources:
amptoo)Here's a screenshot (sorry, German) showing that there is a specific container type for AMP:

Bug Description
Issue 1: When the connection to GTM is made, it automatically inserts the GTM script across standard pages and AMP pages. However, the same GTM container is not meant to be used in both places, as GTM requires a unique container for AMP pages. When the Site Kit GTM connection is made, there needs to be a container selection for standard pages, and a second for AMP pages. Or an option to not insert on AMP.
Issue 1a: The Site Kit GTM script is missing the second half of the required snippet on AMP pages (that goes in the < body >).
Issue 1b: Additionally, there should probably be a note to let the user know to remove the analytics settings they may have input within the AMP plugin settings. As having AMP plugin analytics enabled + Site Kit GTM OR GA auto insert enabled will result in inflated data. This same risk applies to enabling the auto-insert of Site Kit GA snippet with GTM. GA snippet + GTM snippet should not coexist on a page together (when GA is an active variable in GTM), as that too could result in doubled data.
Steps to reproduce
Info for issue 1:
https://support.google.com/tagmanager/answer/9205783
The reason the same container shouldn't be used on both standard pages and AMP pages is due to AMP limitations when it comes to variables, tag types, and how those tags are fired. If the standard GTM container is used on AMP, there could be errors that prevent any data collection at all.
Steps to reproduce issue 1b:
Screenshots
1a Two parts are required for GTM on AMP pages. Site Kit is currently only inserting the < head > snippet.
1b Source code of AMP page with Site Kit GA + Site Kit GTM + AMP plugin analytics
Additional Context
This issue is blocked by #432 and #433.
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
During GTM setup, check if the site is using paired AMP. If yes:

* all drop-downs should have an option either to set up a new account or set up a new container. * in the GTM section of Settings, add information about the AMP container ID as well.Implementation Brief
In Tag Manager setup, if
ampModeissecondary:usageContextisampampContainerswhich it can query from thecontainersdatapoint withusageContextofampcontainersdatapoint to support multipleusageContextsChangelog entry
webcontext and the other forampcontext.The text was updated successfully, but these errors were encountered: