@mabelle
To track iframe pageviews with Google Analytics, you can use the following steps:
- Make sure that the parent page where the iframe is embedded already has the Google Analytics tracking code installed.
- 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.
- In the Google Analytics tracking code for the iframe page, add the following code snippet:
1
|
ga('send', 'pageview', '/iframe-page');
|
- 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.