Introduction to advanced tracking scripts
The simple script given in the moment of the website registration is the fastest way to tag your website and even the quickest one.
Tag a website with a simple script
But sometimes our users need advanced scripts to push more data for their analytics like custom dimensions or custom events.
Script structure
We remind you that every kind of script goes straight to your site's <head>
. If you put it in a different place it may cause an information loss.
The first part of the script is necessary to introduce our API and is the immutable part for every script:
<script defer data-domain="example.com/EXMPL1" src="https://api.publytics.net/js/script.manual.min.js"></script>
Then we have a separate part which is necessary to push events. For example in the simple script is the part that pushes the pageviews (which we strongly recommend to insert in every site).
<script>
window.publytics = window.publytics || function() { (window.publytics.q = window.publytics.q || []).push(arguments) };
publytics('pageview');
</script>
Advanced tracking scripts list
Here you can see a list of the different scripts available for your website.