: Track SUBMIT button inside iframe with Google Analytics I have a lead generation site. I have placed a third party application form in an iframe on our site's application page. I want to track
I have a lead generation site. I have placed a third party application form in an iframe on our site's application page. I want to track how many visitors are clicking on GET FREE QUOTES buttons. In short I want to track all the leads filled from this site within this iframe.
Can anyone please guide me on this?
More posts by @Martha676
1 Comments
Sorted by latest first Latest Oldest Best
Unfortunately under the circumstances you have advised this is not possible. For security reasons cross origin iframes do not allow javascript from the parent frame to interact with the child frame and so there is no way to detect any event within the iframe itself. As @dan indicates in his comment he has identified a solution here which uses a transparent image positioned over the submit button in the iframe but that is very much a messy hack and may not work all the time depending on how it is implemented and positioning, etc.
Some vendors enable cross origin resource sharing (CORS) on their iframe pages so as to enable access to the child frames DOM though it is unlikely in your case I suspect, others enable javascript based API's which trigger events which can be captured in the parent frame when something in the child frame is done. The easiest way to achieve this is to speak to the specific vendor in question and ask them how you can track the button clicks and if they even support it, and if not is it something that they would consider investigating as a later enhancement to their widget.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.