AnsweredAssumed Answered

PRODUCT - Marketo RTP dialog pop up

Question asked by Betsy Chen on Mar 25, 2018
Latest reply on Mar 26, 2018 by Betsy Chen

Passing along a question I got from my web team -

 

We have a business requirement to track Marketo RTP dialog pop-up's LOAD and CLICK events. We are trying to achieve this by calling two java script functions of the parent window. But, it is not working and also pop-up stops loading on the page.

 

This is what we are trying to do -

 

  • Call parent window's function on pop-up loadonLoadEventDatalayer(parentPageURL)

 

  • Call parent window's function on pop-up click - onClickEventDatalayer(parentPageURL)

The actual code is like this -

 

<script>
var
parentURL = window.parent.location;

$( document ).ready(function() {

 

    if(typeof window.parent.onLoadEventDatalayer(parentURL) === 'function') {                   

 

            window.parent.onLoadEventDatalayer(parentURL);

 

    }

 

    $('#trwDialog > div > a').click(function(){

 

        if(typeof window.parent.onClickEventDatalayer() === 'function') {

 

           window.parent.onClickEventDatalayer();

 

        }

 

    });

 

});

 

</script>

 

 

 

Can someone please help us to get this resolved or guide us about the implementation approach.

Outcomes