Delacon's standard JavaScript tracking code functions by firing on page load and replacing the existing Business Number within the page content with the allocated tracking number. However, in the case of Single Page Applications (SPAs) as the user navigates the site the tracking code does not get reloaded and only the necessary site elements are updated. The effect is that the tracking number will only be updated for any instances of the Business Number that exist within the first (approximately) 20 seconds of the users session, and there will be no further updates unless the browser window is refreshed.
In order to overcome this issue, the following script can be used to force a reload of the Delacon tracking code when the user navigates to a new distinct "page" in the Single Page Application.
<script type="text/javascript">
var refCids = "XXXXXX";
if (typeof plaPageReload == "function") {
plaPageReload(refCids);
}
</script>
The var refCids = "XXXXXX"; line needs to be updated with your own CID (replacing XXXXXX), if multiple CIDs are in use these should be comma separated.
This function should be tied to the click event that loads the new "page" so the tracking code can update any new instances of the Business number with the tracking number. The exact method and configuration for your particular site will need to be identified and implemented by a web developer with knowledge of AJAX in line with the following concept.
If you are unable to tie the reload function to the click event, Delacon can enable backend functionality to capture the AJAX events and reload the tracking numbers without additional coding on your website. Please note that this may slow the performance of your website and may not be suitable in all cases. Please contact support@delaconcorp.com for further information.
Comments
0 comments
Please sign in to leave a comment.