Articles on: Integrations

Can I track poptin views? poptinVisible(poptin_id) / Callbacks

Besides tracking your popups and forms views via the our dashboard, you can also the functions below to track views and conversions via GTM. All you need to do it to place the relevant following code above our installation code, inside the same HTML custom tag:

If you want to count views of a specific poptin, install the following code above the main installation code:

<script>
function poptinVisible(poptin_id){
    if(poptin_id == '95f2806aa111'){
        ga('send', 'event', 'Lightbox' , 'View',  'PoptinFSbox');
    }
}
</script>

* Don't forget to change the Poptin ID

If you want to track all your poptins' views, install this code right above the main installation code:

<script>
function poptinVisible(poptin_id){
    ga('send', 'event', 'type' , 'View',  'Poptin');
}
</script>

If you want to track conversions of a specific poptin, install this code right above the main installation code:

<script>
function poptinVisible(poptin_id){
    if(poptin_id == '95f2806aa111'){
        jQ224('.poptin-popup[data-poptin-id="'+poptin_id+'"] .poptin-form-submit-button').attr('id', poptin_id);
    }
}
</script>

* Don't forget to change the Poptin ID

If you decided to use this option, you will need to create a button listener on your GTM this way:

http://www.clixmarketing.com/blog/2017/12/19/time-to-start-tracking-your-button-clicks-in-google-tag-manager/

The trigger name contains: poptin-form-submit-button

If you want to track all your poptins' conversions, install this code right above the main installation code:

<script>
function poptinVisible(poptin_id){
        jQ224('.poptin-popup[data-poptin-id="'+poptin_id+'"] .poptin-form-submit-button').attr('id', poptin_id);
    }
</script>

If you decided to use this option, you will need to create a button listener on your GTM this way:

http://www.clixmarketing.com/blog/2017/12/19/time-to-start-tracking-your-button-clicks-in-google-tag-manager/

The trigger name contains: poptin-form-submit-button

Callbacks:

Script that will Track poptin close event

<script>
function onpoptinClose(poptin_id){
if(poptin_id == '95f2806aa111'){
ga('send', 'event', 'Lightbox' , 'Click', 'PoptinFSbox');
}
}
</script>


Or

<script>
function onpoptinClose(poptin_id){  
//code that user want to execute when poptin closes
}
</script>

Script that will Track poptin submit event

<script>
function onpoptinSubmit(poptin_id){
if(poptin_id == '95f2806aa111'){
ga('send', 'event', 'Lightbox' , 'Click', 'PoptinFSbox');
}
}
</script>


Or

<script>
function onpoptinSubmit(poptin_id){  //code that user want to execute when poptin submits
}
</script>

Updated on: 15/11/2024

Was this article helpful?

Share your feedback

Cancel

Thank you!