> ## Documentation Index
> Fetch the complete documentation index at: https://docs.segmentstream.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Criteo

> Connect Criteo to SegmentStream and import campaign cost data.

## Before you begin

Make sure you have **Admin** rights for the Criteo Account.

<Steps>
  <Step title="Go to Criteo Partners">
    Go to [partners.criteo.com](https://partners.criteo.com/).
  </Step>

  <Step title="Create an Organization">
    Create a new Organization if it is not already created.
  </Step>

  <Step title="Create a new App">
    Click the **Create New App** button.
  </Step>

  <Step title="Fill in app details">
    Fill in the **Name** and the **Description** fields and click **Next**.
  </Step>

  <Step title="Choose authentication method">
    Select **Client credentials** as the authentication method.
  </Step>

  <Step title="Select services">
    In the **Service** section, choose **C-Growth** and **Marketing Solutions** and click **Next**.
  </Step>

  <Step title="Set authorizations">
    In the **Authorizations** section, choose the **Read** value for every Domain in the row and click **Activate app**.
  </Step>

  <Step title="Create API key">
    Scroll to the **App Credentials** section and click the **Create new key** button. The browser will download a text file with the API credentials.
  </Step>

  <Step title="Generate consent URL">
    Click **Generate new URL** in the right upper corner.
  </Step>

  <Step title="Grant portfolio access">
    Click **Generate URL** and copy-paste it in the address bar of the browser. Scroll to the **Portfolio Access** section, choose the **Account name** and click **Ok**.
  </Step>
</Steps>

## Getting started

<Steps>
  <Step title="Navigate to Data Sources">
    Inside the admin panel navigate to the **Data Sources** page and click **+ NEW** on the top right corner.
  </Step>

  <Step title="Select Criteo">
    Choose **Criteo** from the list.
  </Step>

  <Step title="Enter API credentials">
    Open the downloaded file with the API credentials and copy-paste the **Client ID** and **Client Secret**.
  </Step>

  <Step title="Save">
    Click **Save**.
  </Step>
</Steps>

## UTM tagging best practices

Adding a `utm_id` parameter to your tagging template will guarantee improved stitching quality of costs to sessions without altering the rest of your existing UTM tags.

<Steps>
  <Step title="Navigate to Ad Set tracking">
    Go to your **Ad Set** and navigate to the **Ads Tracking** option.
  </Step>

  <Step title="Add the utm_id parameter">
    In the **Track clicks** section, find the **Tracking suffix** field, and append the following parameter that uses [URL macros](https://help.criteo.com/kb/guide/en/about-ad-tracking-YxbuNl0Ddg/Steps/775660,1139312):

    ```plain text theme={null}
    &utm_id={{criteo_campaignid}}_{{adsetid}}_{{adid}}
    ```
  </Step>

  <Step title="Save">
    Click **Save and continue**.
  </Step>
</Steps>

For a detailed guide on how to set up ad tracking, refer to the [Criteo documentation](https://help.criteo.com/kb/guide/en/about-ad-tracking-YxbuNl0Ddg/Steps/775660,1139194).

## Manual UTM matching for campaigns

If the SegmentStream automatic UTM matching does not result in optimal ad cost to session stitching, you will need to match Criteo campaigns manually inside the SegmentStream admin panel.

By default, the following matching applies for `utm_source` and `utm_medium`:

* `utm_source` -- `criteo`
* `utm_medium` -- `cpc`

This matching can be changed inside the admin panel by specifying appropriate values for the **UTM source** and **UTM medium** options.

For all your Criteo campaigns, you need to define matching between the **Campaign ID** and **UTM campaign**.

For example, if you have a Criteo campaign with the **Campaign ID** = `Lower Funnel` with the following link to the website: `http://www.site.com/?utm_source=criteo&utm_medium=retargeting&utm_campaign=lower_funnel`, the mapping should use `lower_funnel` as the UTM campaign value.
