How to embed in a web object such as a button

Updated: 01/30/2019
Article #: 131


If you need to measure/profile click on a button, such as a submit button or download button, use the following...

 

NB - the yellow highlighted texts needs to be updated with the clients specific details.

 

<button id="myButton" class="float-left submit-button" onClick="buttonClick()">Request brochure</button>

 

<script type="text/javascript">

    function buttonClick(){

    //Call RMA pixel by writing script tag when button is clicked

        var script = document.createElement('script');

    script.src = '//pixel.roymorgan.com/stats_v2/Tress.php?u=NcMV9MHeoR&d=11111';

        script.async = true;

        document.body.appendChild(script);

 

        //Do normal button stuff/logic here

        //...

    }

</script>







Rate this FAQ:
Rating: 0.00 / Votes: 0