> For the complete documentation index, see [llms.txt](https://documentation.crossengage.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.crossengage.io/data-and-engagement-platform/web-tracking/web-tracking-v1-legacy/setup.md).

# 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="/files/ts2heJITjL25OKODsgkj" 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 %}

####
