# UTT Installation

{% hint style="warning" %}
**Important:** This integration requires a skilled web developer comfortable with JavaScript, HTML, tag managers, and browser developer tools to configure, implement, and test.
{% endhint %}

## Installation

***

{% stepper %}
{% step %}

### *Step 1: Universal Tracking Tag (UTT)*

Your impact.com account has a unique Universal Tracking Tag specific to your account, which needs to be placed within the global `<head>` tag of your site.

1. Obtain the UTT code snippet by selecting **Menu → Settings** from the left navigation bar.
2. Under *Tracking*, select [General](https://app.impact.com/secure/advertiser/tracking-settings/general-trackingsettings-flow.ihtml) and copy the UTT code snippet.
3. Place this snippet within the global `<head></head>` HTML element of your site. If you use a tag manager, add the UTT as a custom HTML tag.

{% hint style="success" %}
**Note:** The UTT is required for the other two functions — `identify` and `trackConversion` — to work. If the UTT doesn't load before these, the integration can break. Ensure the UTT loads globally across your site before these two functions load.
{% endhint %}
{% endstep %}

{% step %}

### `identify` function&#x20;

The `identify` function is used to identify users accurately across your site, particularly across devices. You'll supply identifiers so impact.com can map them to conversion events for attribution.

Copy the entire code snippet from this document, then modify the snippet's values (bulleted below) with dynamic variables:

{% tabs %}
{% tab title="JavaScript" %}

```javascript
<script>
  ire('identify', {
    customerId: 'Customer Id',
    customerEmail: 'SHA1 Hash of Customer Email'
  });
</script>
```

{% endtab %}
{% endtabs %}

* `customerId`: a visitor's unique identifier that maps to your site's backend systems.
* `customerEmail`: A SHA-1 hash of a visitor's email address.
* If either of these values are unknown, pass an empty string.

Add your modified code snippet in the body section of each page on your website, or use a tag manager to add this code snippet in the body section of each HTML element across your site.

{% hint style="success" %}
**Note:** When you pass the SHA-1 hash of the visitor’s email address, impact.com uses an additional HMAC-SHA-256 hash on the passed value for additional security.
{% endhint %}
{% endstep %}

{% step %}

### `trackConversion` function

The `trackConversion` function is used on your site’s order confirmation page to track the conversion data of an online sale and report it to impact.com.

Copy the entire code snippet from this document. Modify the snippet's values (tabled below) with dynamic variables (all variables are required):

{% tabs %}
{% tab title="JavaScript" %}

```javascript
<script>
  ire('trackConversion', ACTIONTRACKERID, {
    orderId: "Your Order Id here",
    customProfileId: "Your Custom Profile Id here",
    customerId: "Your Customer Id here",
    customerEmail: "SHA1 Hash of Customer Email",
    customerStatus: "New or Existing",
    currencyCode: "USD",
    orderPromoCode: "Your Promo Code here",
    items: [
      {
        subTotal: 100.00,
        category: "Category here",
        sku: "SKU here",
        quantity: 2,
        name: "Product Name here"
      },
      {
        subTotal: 50.00,
        category: "Category here",
        sku: "SKU here",
        quantity: 1,
        name: "Product Name here"
      }
    ]
  }, { verifySiteDefinitionMatch: true });
</script>
```

{% endtab %}
{% endtabs %}

Add your modified code snippet at the top of the \<body> HTML element of the order confirmation page of your site, or use a tag manager to add this code snippet to the top of each \<body> HTML element across your site.

#### `trackConversion` parameter definitions

The table below lists a range of supported parameters that the `trackConversion` function supports. Parameters should be passed a value from your site using dynamic variables when a conversion occurs.

| Parameter         | Description                                                                                                                                                         | Data Type          |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------ |
| `orderId`         | Unique order identifier your platform assigns to orders.                                                                                                            | `ALPHANUMERIC(64)` |
| `customProfileId` | Unique identifier used to identify visitors on your website regardless of whether they're signed in.                                                                | `STRING(70)`       |
| `customerId`      | Unique customer identifier your platform assigns to customer accounts. Do not use personally identifiable data for this field. Pass an empty string if unavailable. | `STRING(255)`      |
| `customerEmail`   | SHA-1 hash of the customer's email address. Pass an empty string if unavailable.                                                                                    | `STRING(255)`      |
| `customerStatus`  | Submit values of either New or Existing. Can be configured to alter payouts.                                                                                        | `ALPHANUMERIC(40)` |
| `currencyCode`    | Three-letter ISO 4217 code for the currency of your platform.                                                                                                       | `STRING(3)`        |
| `orderPromoCode`  | Promotional (or coupon) code applied to the order. Pass an empty string if unavailable.                                                                             | `STRING(64)`       |
| `orderDiscount`   | Total discount amount on the order. This will be subtracted proportionally from the item-level subtotals when revenue values are calculated by impact.com.          | `DECIMAL(8,2)`     |
| `subTotal`        | SKU set subtotal of the line item (pre-tax, pre-shipping, pre-discount).                                                                                            | `DECIMAL(8,2)`     |
| `category`        | Item category identifier. Can be configured to alter payouts.                                                                                                       | `STRING(64)`       |
| `sku`             | Item stock-keeping unit (SKU) identifier.                                                                                                                           | `ALPHANUMERIC(40)` |
| `quantity`        | Item quantity.                                                                                                                                                      | `INTEGER`          |
| `name`            | Item name.                                                                                                                                                          | `STRING(128)`      |

#### `trackConversion` example payload

See the example payload of a tracked conversion:

{% tabs %}
{% tab title="Shell" %}

```javascript
<script>
  ire('trackConversion', `${eventId}`, {
    orderId: "1234567",
    customerId: "Customer Id here",
    customerEmail: "SHA1 Hash of Customer's Email",
    customerStatus: "New",
    currencyCode: "USD",
    orderPromoCode: "ACME",
    orderDiscount: 15.00,
    items: [
      {
        subTotal: 28.00,
        category: "Product Category 1",
        sku: "sku-11111",
        quantity: 2,
        name: "Football"
      },
      {
        subTotal: 99.00,
        category: "Product Category 2",
        sku: "sku-11112",
        quantity: 3,
        name: "Men's Jersey"
      }
    ]
  }, { verifySiteDefinitionMatch: true });
</script>
```

{% endtab %}
{% endtabs %}

**Notes**

* There are two (2) Footballs being purchased at a unit price of 14.00 which is a SKU set subtotal of 28.00.
* There are also three (3) Men’s Jerseys being purchased at a unit price of 33.00 each for a SKU set subtotal of 99.00.
* impact.com will take the 15.00 discount passed and apply that proportionately to all items in the purchase.
  {% endstep %}
  {% endstepper %}

### End-to-End Testing

Once the impact.com app is fully installed, you can begin end-to-end testing to ensure everything is working properly. Learn how to proceed with [End-to-End Testing](/integration-guides/end-to-end-tests.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://integrations.impact.com/integration-guides/for-brands/checklist-tracking-integrations/utt-installation.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
