im stuck, i hope that someone can help me.
In order to track clicks in an iframe, i did something unusual: i inserted an analytics script inside the head of the iframed page. then i used analytics events in order to track clicks on that iframe.
you can see an example here: https://www.digital4.biz/retail/ecommerce-oltre-11-milioni-di-clienti-abituali-l-analisi-del-politec...
the event triggered after click is onclick="ga('send','event','Lead','click_txt','CRM_266_2')"
the iframe src (https://filedig.ctmobi.it/redazioni/crm.html)
do you think this can be done? or can it cause some conflicts?
i have uncoungruent data: the number of clicks (events) tracked for the first GA property (the iframe), are not corresponding to the number of sessions that i get after the link with utm parameters has been viewed after the click.
Do you have any idea on why this could happen?
Hope I was clear enough, else, I can give you more information!
Hope someone could help as im stuck here and seem to find no easy way out!
Thanks a lot for help on this.
Re: iframe tracking
I checked with our tech team and we were unable to locate any iFrame set to the src '(https://filedig.ctmobi.it/
What you're doing should work. However, the clicks on an element may not match the pageviews to the link being clicked on -- you can expect a certain level of discrepancy, and, depending on the implementation, the discrepancy could go either way (more clicks than sessions, or more sessions than clicks). Here are some of the reasons:
- The entire iFrame isn't linked to a page, only a part of it is. However, clicks on any part of the iframe will be tracked using the lead event.
- Users who prevent the page from loading (stop or back button) after clicking the link
- Race Condition: The page loads prior to GA tracking the click