Learn business growth with Google Analytics 4 Forums Google Analytics 4 Tracking page views of an embedded child page in GA4 using iframes

  • Tracking page views of an embedded child page in GA4 using iframes

    Posted by Brooke on 26 March 2023 at 6:47 am

    Hey there! I’m using GA4 to keep tabs on my page views (PVs). I’ve got an iframe in my main page for a child page, but I can’t seem to figure out how to measure the PVs on that child page.

    I had a look with GTM’s preview and it looks like the GA4 tag for the child page is working, but I can’t seem to get the Page view event to fire off.

    Anyone got any tips on how I can make the Page view event fire off even on the page within my iframe?

    Liam replied 1 year, 4 months ago 3 Members · 2 Replies
  • 2 Replies
  • Ashton

    Member
    27 June 2023 at 4:26 pm

    Hey there! You might want to check your GTM Tag Configuration. There should be a trigger for ‘All Pages’, which usually has ‘Page View’ as the default type. Make sure this is activated. Here let me show you an image for it: [photo](https://i.stack.imgur.com/7lGld.png).
    Just give that a look and hopefully that should get your Page View events firing off again! Let me know how it goes!

  • Liam

    Member
    4 July 2023 at 3:48 am

    There could be a few reasons why the Page view event isn’t firing in the iframe. The key thing to note here is that iframes can have their own independent tracking. Try adding a GTM container to the child page that is direct in the iframe. Check if there’s anything in the iframe that is blocking the GTM or GA tags. Make sure that the domain of the iframe page also has been added in the Referral Exclusion list in GA. It might be the case that the GA4 considers the iframe as a new session if it’s not in the list. Following these steps, you should be able to see if the Page view event fires or not. Once you are sure that GTM and GA4 are working properly in the iframe, you would then be able to track the PVs on that child page.

Log in to reply.