This article applies only to accounts using the full funnel LeadsRx Attribution product.

If your company uses a single-page application (SPA), you will need to use a modified Universal Pixel to measure attribution in LeadsRx. You will need a developer to finish the script based on the regex instructions.

The difference with a single-page application or website is that regular page view tracking does not work because all of the necessary code is loaded once and the page does not reload during the entire user session. The following modification will enable the expected behavior.

Here is the code for the modified Universal Conversion Tracking Pixel:

var _lab = _lab || []; // This must be defined as a global
    function loadLeadsRx() {
    _lab.push("[PUT YOUR ACCOUNT TAG HERE]");
        var lab = document.createElement('script');
        lab.type = 'text/javascript';
        lab.async = true;
        lab.src = ('https:' == document.location.protocol ? 'https://app' : 'http://app') + '.leadsrx.com/visitor.js';
        var s = document.getElementsByTagName('script')[0];
        s.parentNode.insertBefore(lab, s);
    }
  //add a check to see if script is already loaded, if so, only call a 'virtual pageview' event, if not, load script
  //script can be determined by the existence of the function window._lrx_sendEvent
  if(window._lrx_sendEvent){
        //second parameter is 'name of page', using url path
        window._lrx_sendEvent('page', document.location.pathname); 
    }
  else{
        loadLeadsRx();
    }

As you can see in the code there are REGEX instructions for your developer to follow to complete the configuration of the pixel. Because of the complexity of SPAs, both on the front and back end, they cannot be tracked with a true universal pixel and this must be modified to work for your website.