Clicky

  1. Home
  2. How To
  3. How to add more parameters in Google Analytics for AMP

How to add more parameters in Google Analytics for AMP

Let’s see how to add Advanced Google Analytics like page, event, social tracking in AMP.

1. Enable the Options

You will find this option in the WordPress Admin Area -> AMP option panel -> Settings -> Analytics

  • Google Analytics: First enable the Google Analytics option and Enter the Analytics ID.

2. Add the Advanced Analytics Code

  • Advanced Google Analytics: Enable the Advanced Google Analytics option. As you can see there is a JavaScript editor to add the Analytics code in JSON format.
  • Change the “UA-xxxxxxx-x” with your Google Analytics ID.
  • Enter other tracking code in place of “// Enter your Advanced Analytics code here”.

Example code:

You can insert title, URL, and id as {title}, {url} and {id} respectively.

For example:

URL, Title and post ID can be passed shown below.

Before adding this two variable make sure you need to activate Yoast SEO plugin.

After adding another tracking code, your code should look like this:

Note: This is just an example code used only for demonstration purpose. 

I hope this tutorial helps you to successfully add the Analytics on your site and If you encounter any issue you can reach us for the help here.

Google Documentation for AMP analytics: https://developers.google.com/analytics/devguides/collection/amp-analytics/

That’s it for this tutorial!

We hope it helped you. If you have any feedback or questions, then please share them in the comments section below.

Ask your Questions Directly!
If you can't find the solutions in this article, then just ask us in the comments and we will answer it for you!
Updated on June 14, 2019

Was this article helpful?

Related Articles

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support

Leave a Comment