PageViews tracked within an IFRAME

1,287 views
Skip to first unread message

Brook Davies

unread,
Sep 14, 2013, 11:39:11 PM9/14/13
to google-analyti...@googlegroups.com
Hello,

We are trying to create a solution for our clients to use, so that they can embed our "forms" on their website inside an IFRAME and have the Google Analytics session from their domain/parent pass through to the IFRAME so that we can use the Event Tracking library to record various form events. This is all working great, and was fairly easy to implement.  The problem is this:

Within the IFRAME, we simply include the GA code to load the scripts and a call to ga('create'..) using the user supplied domain,ua and the clientID passed into the IFRAME from the parent. Everything works great. We then record various events. But when we watch the real time monitor in GA, it shows the users path to the path of our FORM as opposed to the parent page it is embedded on. We are not recording a pagview, so why does this appear as a pageview, or will it only be shown like that in the real time monitor?

Our preference would be that it just showed the user on the parent page (our clients URL/page) and our form (inside the iframe, running off our domain) just recorded events.

If this is just a Real Time Monitor thing? Or are "pageviews" being triggered somehow?

Below is the example of the code (run inside the iframe from our domain), which results in the real time monitor showing the user on our URL as opposed to the parent page.

(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
    (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
    m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    // create the qa instance based on the values based through the form
    ga('create',
    'UA-191952-2',
    'logiforms.com',
    {
     'clientId' : '431794023.1359758036',
     'storage'  : 'none'
    }
   );

   ga('send', {
        nonInteraction:'0',
        eventLabel:'Google Analytics Example - Processed',
        eventAction:'Form Processed',
        hitType:'event',
        eventValue:'1',
        eventCategory:'Form Interactions'
    });

Brad Townsend

unread,
Sep 19, 2013, 6:14:08 PM9/19/13
to Brook Davies, google-analyti...@googlegroups.com
Hi Brook,

I don't see anything in the snippet you've posted that would trigger a pageview hit. Are you seeing these pageviews only in your Realtime reports? Or are these hits showing up in Standard reports as well?

-Brad



--
You received this message because you are subscribed to the Google Groups "google-analytics-analyticsjs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-analytics-ana...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

tangleanalytics

unread,
Nov 16, 2015, 8:45:01 PM11/16/15
to google-analytics-analyticsjs
Hello Brook,

I am facing a similar issue, only difference being the iframe contains video not the form. I want to send events for video Play, stop, pause etc. but it is sending the pageviews as well and these are showing up in both RT reports and standard reports.

If you ever got a solution to your problem and share it, it would be very helpful.

Thanks,
Kriti
Reply all
Reply to author
Forward
0 new messages