In a previous blog post, we mentioned that AMP pages can only use a limited amount of code due to restrictions on page expression.
The same applies when measuring traffic when delivering advertisements or operating web pages.
Due to certain constraints, they are managed by the container for AMP pages.
Therefore, there are also tags (code snippets) that are embedded on websites for measurement that are specific to AMP.
As you will notice when you run it, the notation risk managers email database and embed position are slightly different from the two code snippets of regular Google Tag Manager.
▼Normal circumstances
For detailed instructions on how to create and configure the tag, please see Google Tag Manager Help .
How to install Tag Manager in AMP
1. Create an AMP container in Tag Manager .
2. Add the Tag Manager snippet to your AMP page .
3. Set tags in Tag Manager containers and publish
Quote: Google "AMP and Tag Manager Setup Guide"
②When setting conversions on AMP pages, external links require special notation (attribute settings)
If you want to measure conversions for external link URLs on an AMP page,
You need to include attributes in the link URL.
Therefore, for pages with GTM (for AMP) embedded,
You will need to set up the external URL to have user-defined variable attributes.
▼ Setting user-defined variables (AMP version) (Partial excerpt)
In order to make the link URL available as a user-defined variable,
the <a> tag has an attribute called "data-vars-href", and
in addition to the link URL that was originally written only in the "href" attribute of the <a> tag,
the link destination URL is also written in the "data-vars-href" attribute.
Quote: "How to count the number of clicks on external links on AMP pages using Google Tag Manager"
In this case, the share button already has the AMP-specific code <amp-social-share> , so you can use the AMP variable global replacement within this element .
③The Facebook share button on an AMP page requires an app ID to be set
At the end of the external link in ②, I mentioned the share button.
There is one thing to be careful of here as well.
It's the Facebook share button.
The Facebook share button requires you to set an ID [fb:app_id] (Facebook app ID) to create an app on Facebook.
If you do not set this, errors will occur with the share button and AMP test.
If it is a normal page, you can choose not to set the app ID.
In AMP, the use of "onclick" (a statement used to open a small window) is prohibited, so if you use it, it will not be recognized as an AMP page.
Caution is required.
You can issue a Facebook App ID by following these steps:
Value Creation Co., Ltd.
[Updated April 2019] How to get a Facebook app ID | Value Creation Co., Ltd.
[Updated April 2019] How to obtain a Facebook app id. We are a cross-media agency that discovers consumer insights and comprehensively supports promotional activities based on the value proposition of the brand and services that our clients offer.
Reference: [Updated April 2019] How to get Facebook app ID
summary
This time, the focus was on tags for measurement and source code.
The person in charge of creating a web page will of course be aware of the design and effects (methods of expression), but it will also go a long way if they understand the code that runs behind the scenes and is needed for operation.
***
While most web advertising companies focus on advertising management, we plan, implement and improve the entire web promotion process.
In addition, in the area of marketing automation, we provide comprehensive web promotion and marketing automation services, from implementation support to campaign design in conjunction with advertising measures after implementation.
You need to embed the Google Tag Manager code for AMP
-
- Posts: 58
- Joined: Tue Jan 07, 2025 4:28 am