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'
});