<script>
setTimeout(function(){
var message = JSON.stringify ({
event: 'purchase',
id: '{{ event.id }}'
});
parent.postMessage (message, 'https://www.parenturl.com');
}, 2500);
</script>
<script>
window.addEventListener('message', function(message) {
if (message.origin.indexOf('iframeurl.com') > 1) {
var data = JSON.parse(message.data);
var dataLayer = window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': data.event,
'id': data.id
});
}});
</script>
-
Notifications
You must be signed in to change notification settings - Fork 0
maroufali/GTM-iFrame-Tracking
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published