Integration

In order to integrate our web analytics JS, you need to include the following snippet in the <head> tag of all the pages you'd like to track pageviews on.

<script type="text/javascript">
  window._ALPINA_ID="PROFILE_UUID";
  (function() {
    d=document;s=d.createElement("script");
    s.src="https://x.alpina.io/wa.js";
    s.async=1;
    d.getElementsByTagName("head")[0].appendChild(s);
  })();
</script>

You must replace the value of wndow._ALPINA_ID with your profile id, you can copy profile id's on this page

Additionally, if you plan to use event tracking than you can also add an on load event to make sure the script has loaded. Like so:

window.onAlpinaWebAnalyticsLoad = function() {
  // this function will be fired whenever the script above has loaded.
  // make sure that this code gets executed BEFORE the tracking code above
}

Last updated