Skip to content

Instantly share code, notes, and snippets.

View hussainm's full-sized avatar

Hussain hussainm

View GitHub Profile
@transparenceweb
transparenceweb / gtm-iframe-child.html
Last active November 13, 2018 02:29
Using Google Tag Manager to track a site and have a 3rd party element loading into an iframe. Need to track an event onclick within the iframe and have it push to the dataLayer on the parent page. Adding GTM snippet to child page not a possibility so using typical dataLayer.push({'event': 'event_name'}); will not work. Apply following workaround…
<!doctype html>
<html>
<head>
<title>Child page</title>
<!-- Stylesheet -->
<style type="text/css">
body
{