How to track iframe pageviews with google analytics?

Member

by mabelle , in category: SEO Tools , 2 months ago

How to track iframe pageviews with google analytics?

Facebook Twitter LinkedIn Telegram Whatsapp Pocket

1 answer

Member

by arlo , 2 months ago

@mabelle 

To track iframe pageviews with Google Analytics, you can use the following steps:

  1. Make sure that the parent page where the iframe is embedded already has the Google Analytics tracking code installed.
  2. Add a separate Google Analytics tracking code to the iframe page. This tracking code should be different from the one used on the parent page. You can create a new property in Google Analytics for tracking the iframe pageviews.
  3. In the Google Analytics tracking code for the iframe page, add the following code snippet:
1
ga('send', 'pageview', '/iframe-page');


  1. Test the tracking by loading the parent page with the iframe and navigating to the iframe page. Check Google Analytics to see if the pageview is being tracked correctly.


By following these steps, you can track pageviews of the iframe page separately from the parent page in Google Analytics.