# Setup

To set up web tracking on your website, first you need to copy the Web Tracking code snippet from the CrossEngage app.

* Go to Settings -> System Setup.
* Click on Web Tracking, and copy the code snippet.

<figure><img src="https://985110910-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F0Hio8LJewN8lQY2Vlqy0%2Fuploads%2FPIyE8hFFtRicB3QPagHp%2FWebTracking.png?alt=media&#x26;token=aa95e694-d8f5-4d3f-b503-f1f25c78109d" alt=""><figcaption></figcaption></figure>

You can also copy the code below; Please make sure to add your Web-Tracking Key in the first line of the code.

{% code overflow="wrap" %}

```javascript
window.xngID = "your-tracking-key";

!function(e,n,t){function r(e){return function(){return t.push(Array.prototype.concat.apply([e],arguments)),t}}function i(){var e=document.createElement(n),t=document.getElementsByTagName(n)[0];e.async=!0,e.src="https://app.crossengage.io/analytics.min.js",t.parentNode.insertBefore(e,t)}var o,a=["trackSubmit","trackClick","trackLink","trackForm","pageview","identify","group","track","ready","alias","page","once","off","on"];if(t=e.analytics=e.analytics||[],!t.initialize)if(t.invoked)e.console&&console.error&&console.error("CrossEngage snippet included twice.");else{for(t.invoked=!0;o=a.shift();)t[o]=r(o);i()}}(window,"script");
```

{% endcode %}

#### Installing the Code Snippet

{% tabs %}
{% tab title="Using a Tag Manager" %}

* Create a tag that contains *Custom HTML*
* Once created, paste the snippet and wrap it between `<script></script>`.
* Ensure that you create or select a trigger, one that listens for a successful page load, for your newly created snippet. For **single page applications**, you will only need to **trigger the tag once**, however, for **multi page applications**, you should **trigger the tag** **on every successful page load**.&#x20;
  {% endtab %}

{% tab title="Without a Tag Manager" %}
Paste the code snippet to the \<head> of your website, wrapped in \<script>...\</script>.
{% endtab %}
{% endtabs %}

####
