You should try to install the conversion code after the website tracking code. However, that might not always be possible. In cases like this you can use a "delayed" conversion code that will wait on the tracking script to load before registering the conversion.

Here's how the "delayed" conversion is captured on a "thank you" page:

<script type="text/javascript">
  var cg_dconvert = setInterval(function() {
    if(window['cg_convert']) {
      cg_convert();
      clearInterval(cg_dconvert);
    }
  }, 100);
</script>

In case you're tracking a specific event and there's a chance it would trigger before the website tracking code loads, you can attach it like this:

<script type="text/javascript">
  $(function(){
    document.getElementbyId('subscribe-button').addEventListener('click',function(){
      var cg_dconvert = setInterval(function() {
        if(window['cg_convert']) {
          cg_convert('subscribed');
          clearInterval(cg_dconvert);
        }
      }, 100);
    });
  });
</script>

Hint: Need help capturing conversions? Don't hesitate to contact ClickGUARD support, we'll come up with a custom solution for you when needed.

Did this answer your question?