Google Analytics/GTM problem with outbound event not firing in outbound iframe affiliate link

If you are an expert with Google Analytics/Google Tag Manager and know about Amazon affiliate product links, this question is for you.

One of the Amazon Product Links uses iframe, and it doesn’t fire an event. In the GTM debugging preview mode, it shows that the Label is undefined. It works for regular outbound text links, but something about this iframe GTM doesn’t like it so it doesn’t fire.

I’m using Click URL as the event, but I’m wondering if that’s the issue, because this iframe HTML Amazon.com generates for affiliate sales doesn’t have the regular URL embedded in there.

<iframe style=“width:120px;height:240px;” marginwidth=“0” marginheight=“0” scrolling=“no” frameborder=“0” src=“//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=US&source=ac&ref=tf_til&ad_type=product_link&tracking_id=bustercrab-20&marketplace=amazon&region=US&placement=059035342X&asins=059035342X&show_border=true&link_opens_in_new_window=true&price_color=333333&title_color=0066c0&bg_color=ffffff”>
</iframe>
I looked around about Google Analytics and iframes, and saw an old web page about putting the GA code on the iframe, but that’s not possible because it is going to a 3rd-party.

So I’m not sure if the problem is with the iframe code, or another type of Event tracking is needed in GTM?

I have no idea why the above iframe code I pasted is displaying “product” as “pr oduct” for product_link.

Is the event handler in the iframe or is it in the containing page? If it’s in the containing page then I’m pretty sure it’s not going to work.

I don’t think you can handle events triggered in an iframe outside the iframe. That would be a security risk.

Am I misunderstanding you?

It’s in the iframe. Interesting, how could it working within the iframe be a security risk?

Working within the iframe wouldn’t be a security risk. I thought you were trying to trigger an event handler that is outside the iframe. That could be a security risk if it were possible.

Does the handler attempt to reference something outside the iframe?

Yes, the 3rd-party is Amazon.com. This is for affiliate sales. Amazon does a built-a-link thing for products, and it generates the iframe code I provided.

<iframe style=“width:120px;height:240px;” marginwidth=“0” marginheight=“0” scrolling=“no” frameborder=“0” src=“//ws-na.amazon-adsystem.com/widgets/q?ServiceVersion=20070822&OneJS=1&Operation=GetAdHtml&MarketPlace=US&source=ac&ref=tf_til&ad_type=pr oduct_link&tracking_id=bustercrab-20&marketplace=amazon&region=US&placement=059035342X&asins=059035342X&show_border=true&link_opens_in _new_window=true&price_color=333333&title_color=0066c0&bg_color=ffffff”>
</iframe>

I tired adding the GTM code to the iframe, but it has no effect. Maybe the GTM and the GA code needs to be included? When I click on the link in the GTM preview it opens a new page and that works, but it doesn’t show any action that it has been clicked on. There is no gtm.* stuff provided.

Maybe iframe isn’t ready for prime-time for using this with GTM/GA?