Step 1 - Integrate Tracking Snippet

Adding the JavaScript snippet to your web pages is the quickest way to start passing data to Adtriba.

Copy and paste this snippet just right before the </head> HTML-tag.

<script type="text/javascript">
(function(){
    var id = "adtriba-js";
    var init = document.getElementById(id);

    if (!init) {
        var a = document.createElement("script");
        var s = document.getElementsByTagName("script")[0];

        a.setAttribute("data-project-tracker-id", "YOUR_PROJECT_TRACKER_ID");

        a.type = "text/javascript";
        a.async = true;
        a.id = id;
        a.src = "https://cdn.adtriba.com/v2/adtriba.js";
        s.parentNode.insertBefore(a, s);
    }

    window.adtriba = window.adtriba || [];
    window.adtriba.push(["pageview"]);
})();
</script>


Step 2 - Track Conversions

For the marketing performance report, it is necessary to track conversions. Place this JavaScript snippet on the "Order Confirmation" or "Thank You" pages.

<script type="text/javascript">
    window.adtriba = window.adtriba || [];
    window.adtriba.push(["conversion", "Transaction", {
        id: "ABCDE123456",
        revenue: "49.99",
        currency: "EUR"
    }]);
</script>


Step 3 - Identify Users

Use this snippet to identify the user by its unique ID (e.g. database ID or email). Trigger this snippet after the user signed up or logged in.

<script type="text/javascript">
    window.adtriba = window.adtriba || [];
    window.adtriba.push(["identity", "john.doe@example.com"]);
</script>

You can also provide an encoded ID. In this example, we encoded john.doe@example.com with the SHA-256 hash function.

<script type="text/javascript">
    window.adtriba = window.adtriba || [];
    window.adtriba.push(["identity", "836f82db99121b3481011f16b49dfa5fbc714a0d1b1b9f784a1ebbbf5b39577f"]);
</script>
Did this answer your question?