{"id":221,"date":"2017-03-20T08:11:27","date_gmt":"2017-03-20T08:11:27","guid":{"rendered":"https:\/\/ampforwp.com\/tutorials\/?p=221"},"modified":"2020-02-14T11:23:36","modified_gmt":"2020-02-14T11:23:36","slug":"how-to-add-analytics-in-amp","status":"publish","type":"ht_kb","link":"https:\/\/ampforwp.com\/tutorials\/article\/how-to-add-analytics-in-amp\/","title":{"rendered":"How to Add Analytics in AMP"},"content":{"rendered":"\n<p><strong>Follow this steps to add Analytics in AMP<\/strong><\/p>\n\n\n\n<p>First go to <strong>WordPress Admin Area<\/strong> -&gt; <strong>AMP option panel<\/strong> -&gt; <strong>Settings <\/strong>-&gt; <strong>Analytics<\/strong>.<\/p>\n\n\n\n<p>In&nbsp;<strong>Analytics Type<\/strong>&nbsp;Option you can use&nbsp;<strong>Google Analytics&nbsp;<\/strong>or any other Analytics of your choice.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"483\" src=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/12\/2-1024x483.png\" alt=\"\" class=\"wp-image-15179\" srcset=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/12\/2-1024x483.png 1024w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/12\/2-300x142.png 300w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/12\/2-768x363.png 768w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/12\/2-50x24.png 50w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/12\/2-60x28.png 60w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/12\/2-100x47.png 100w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2019\/12\/2.png 1220w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul><li><strong>Google<\/strong> <strong>Analytics<\/strong>: When you enable&nbsp; <strong>Google Analytics<\/strong>, you must enter your Google Tracking ID. Pasting <strong>Scripts<\/strong>&nbsp;are&nbsp;<strong>not allowed<\/strong>.&nbsp;Even if you use other Analytics, make sure you&nbsp;<strong>Enter tracking ID<\/strong> but not the Script. If you paste any script in analytics, it will lead you to errors.&nbsp; Once disable Advanced Google Analytics and you save Tracking id option output will be checked into source code it will be shown below the footer area.<\/li><li><strong>IP Anonymization:<\/strong>  Allow website owners to request that all of their users&#8217; IP addresses are anonymized within the product. This feature is designed to help site owners comply with their own privacy policies. <\/li><li><strong>For example<\/strong>, if a website visitor has a public IP of <strong>12.214.31.144<\/strong> then as soon as the IP data is received by the Analytics Collection Network, Google will anonymize\/mask the IP to <strong>12.214.31.0<\/strong>. <\/li><li>It is important to remember that IP anonymization occurs before any data storage or processing takes place. So Google does not store or process complete IP addresses at any given time. <\/li><li><strong>AMP Linker: <\/strong>AMP Linker is a new feature in AMP that helps keep user session in sync. It works by decorating outgoing links from AMP cache with params such as AMP Client ID in a URL parameter. On the receiving side, your analytics provider consumes the parameter and writes it down as a first-party cookie for more details <a href=\"https:\/\/ampforwp.com\/tutorials\/article\/what-is-amp-linker-option-and-how-to-use-it\/\">Click Here<\/a>. <\/li><li><strong>Advanced Google Analytics: <\/strong>If you enable this option you can&nbsp; Enter your Advanced Analytics code here inside this code you have to write account number for ex :(&#8220;account&#8221;: &#8220;UA-xxxxxxx-x&#8221;).<\/li><\/ul>\n\n\n\n<h2>Enabling the IP Anonymization feature in Google Analytics for analytics.js<\/h2>\n\n\n\n<p>The IP Anonymization feature in Google Analytics is not enabled by default.<\/p>\n\n\n\n<p>You would need to enable it by making a small code change or by adding a new variable in your GTM tag.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"830\" height=\"330\" src=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/02\/6-5.png\" alt=\"\" class=\"wp-image-16428\" srcset=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/02\/6-5.png 830w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/02\/6-5-300x119.png 300w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/02\/6-5-768x305.png 768w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/02\/6-5-50x20.png 50w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/02\/6-5-60x24.png 60w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/02\/6-5-100x40.png 100w\" sizes=\"(max-width: 830px) 100vw, 830px\" \/><\/figure>\n\n\n\n<ul><li><strong>Google Tag Manager: <\/strong>When you enable to use of <strong>Google Tag Manager,\u00a0<\/strong>then you have to enter\u00a0the <strong>Tag Manager ID. <\/strong><\/li><\/ul>\n\n\n\n<h4><strong>General Analytics Providers<\/strong><\/h4>\n\n\n\n<p>The below-shown details are about some of the General Analytics Providers which are supported by our plugin &#8211; <strong>Facebook Pixel, Segment Analytics, Matomo (Piwik) Analytics, Quantcast Measurement, comScore, Effective Measure, StatCounter, Histats Analytics, Yandex Metrika, Chartbeat Analytics, Alexa Metrics, AFS Analytics, Adobe Analytics&#8230;<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" loading=\"lazy\" width=\"921\" height=\"1024\" src=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/02\/7-5-921x1024.png\" alt=\"\" class=\"wp-image-16431\" srcset=\"https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/02\/7-5-921x1024.png 921w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/02\/7-5-270x300.png 270w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/02\/7-5-768x853.png 768w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/02\/7-5-45x50.png 45w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/02\/7-5-54x60.png 54w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/02\/7-5-90x100.png 90w, https:\/\/ampforwp.com\/tutorials\/wp-content\/uploads\/2020\/02\/7-5.png 1042w\" sizes=\"(max-width: 921px) 100vw, 921px\" \/><\/figure>\n\n\n\n<p><strong>That\u2019s it for this tutorial!<\/strong><\/p>\n\n\n\n<p>We hope it helped you. If you have any feedback or questions, then please share them in the comments section below.<\/p>\n<div id=\"div-1\" class=\"hkb-feedback\">\n\t\t\t<strong class=\"ht-mobile-exit__title\">Ask your Questions Directly!<\/strong><br>\n\t\t\t<div class=\"hkb_widget_exit__content\" style=\"font-size: 14px;\">If you can't find the solutions in this article, then just ask us in the comments and we will answer it for you!<\/div>\n\t\t\t<a href=\"https:\/\/ampforwp.com\/support\/#contact\" id=\"button\" target=\"_blank\" rel=\"noopener noreferrer\"><button>Yes, I have a Question<\/button><\/a>\n\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>Follow this steps to add Analytics in AMP First go to WordPress Admin Area -&gt; AMP option panel -&gt; Settings -&gt; Analytics. In&nbsp;Analytics Type&nbsp;Option you can use&nbsp;Google Analytics&nbsp;or any other Analytics of your choice. Google Analytics: When you enable&nbsp; Google Analytics, you must enter your Google Tracking ID. Pasting Scripts&nbsp;are&nbsp;not&#8230;<\/p>\n","protected":false},"author":1,"comment_status":"open","ping_status":"open","template":"","format":"standard","meta":[],"ht-kb-category":[84],"ht-kb-tag":[25],"_links":{"self":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/221"}],"collection":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/comments?post=221"}],"version-history":[{"count":29,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/221\/revisions"}],"predecessor-version":[{"id":16433,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb\/221\/revisions\/16433"}],"wp:attachment":[{"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/media?parent=221"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-category?post=221"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/ampforwp.com\/tutorials\/wp-json\/wp\/v2\/ht-kb-tag?post=221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}