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

# Yandex as a Traffic Source

> Track Yandex Direct campaigns in ClickFlare: capture yclid and ad data, and send conversions to Yandex via Metrica offline uploads.

![Yandex traffic source template](https://mintcdn.com/clickflare/Z7FseNUODe2P_cAH/images/integrations/covers/templates/yandex.png?fit=max\&auto=format\&n=Z7FseNUODe2P_cAH\&q=85\&s=838a2e36b817d4c2ede61d496fbabf52)

Yandex Direct is Yandex's ad platform. It shows ads on Yandex search results and across the Yandex Advertising Network of partner sites and apps. This guide sets up Yandex as a traffic source in ClickFlare. It covers passing Yandex Direct's click data into your reports and getting your conversions back into Yandex, so its bidding learns from the results you see in ClickFlare.

You do everything from the **campaign editor**. The Yandex traffic source is created inline, without leaving the campaign.

Yandex is different from most networks in one way: it has no S2S postback URL. Conversions reach Yandex Direct through Yandex Metrica, either from the Metrica tag on your pages or from an offline conversion upload matched on the Yandex click ID. Step 2 explains both.

## At a glance

| | |
| - | - |
| **Ad formats** | Search ads on Yandex, text-and-image and display ads on the Yandex Advertising Network |
| **Click ID macro** | `{yclid}`, the ID of the click on the Yandex Direct ad |
| **Conversion tracking** | No postback. Yandex Metrica goals, or an offline conversion upload to Metrica matched on `yclid` |
| **Payout passed back** | Only through the offline upload, in its `Price` and `Currency` columns |
| **Multiple events** | Yes, one Metrica goal per event |
| **Cost** | Not passed. The template has no cost row. Cost Model: **CPC**. |
| **Conversion API** | No |

## How it works

**1. Yandex sends the click**

A visitor clicks your ad. Yandex Direct opens your ClickFlare campaign URL and fills in its dynamic parameters: the click ID in `yclid`, plus the campaign name, ad, keyword, placement and position.

**2. ClickFlare stores the Yandex click ID**

ClickFlare saves the value of `yclid` as the visit's **External ID** and redirects the visitor to your lander or offer.

**3. The conversion reaches ClickFlare**

Your affiliate network or store posts the conversion back to ClickFlare, matched on the ClickFlare click ID. ClickFlare now knows which `yclid` converted.

**4. Yandex Metrica receives the conversion**

ClickFlare can't post to Yandex. Instead, the conversion reaches Yandex Metrica, either through the Metrica tag on a page you control or through an offline conversion file that lists the converting `yclid` values. Yandex Direct then optimizes on that Metrica goal.

> [!NOTE]
>
> The mirror to keep straight: in the **campaign URL** you write *ClickFlare's* parameter (`yclid`) and *Yandex's* dynamic parameter (`{yclid}`). The template does this for you. There is no postback to write. On the way back, the click ID goes into the **`Yclid` column** of a Yandex Metrica offline conversion file, filled from ClickFlare's **External ID**.

## Before you start

* **Set up your own tracking domain.** Run the campaign on your own custom domain. Shared domains get flagged by networks and blocked by browsers, and Yandex moderates the domains in your ad links. See [Custom Domains](/docs/en/settings/custom-domains.md).
* **Have an offer ready in ClickFlare**, and its affiliate network set up to post conversions back to ClickFlare. See [Creating an Offer](/docs/en/tracking/creating-an-offer-1.md) and [Adding an Affiliate Network](/docs/en/tracking/adding-an-affiliate-network.md).
* **Have a Yandex Metrica tag.** Both ways of sending conversions to Yandex go through Metrica. You need a tag (counter), access to its **Goals** and **Settings** pages, and the tag linked to your Yandex Direct campaigns.
* **Decide which conversions Yandex should receive.** Yandex Direct optimizes on the Metrica goals you choose. If your funnel has several steps (lead, then sale), decide now whether to send one goal or several. See [Tracking several events](#tracking-several-events).

***

## Step 1 – Create the campaign and the Yandex traffic source

1. Go to **Campaigns** and click **New**.
2. In **Traffic Source**, open the dropdown and click **+ New Traffic Source**.
3. Type `yandex` in the search box and select the **Yandex** template.
4. Enter a **Name**, for example `Yandex Direct`.
5. Set **Cost currency** to the currency your Yandex Direct account is billed in, for example RUB, USD or EUR. See [Multicurrency in ClickFlare](/docs/en/tracking/multicurrency-support-in-click-flare-how-it-works.md).

The template fills in the **Parameters** table for you:

| Name | TS Parameter | TS Token (Yandex dynamic parameter) | ClickFlare Token | What it carries |
| - | - | - | - | - |
| externalId | `yclid` | `{yclid}` | `{external_id}` | Yandex Direct's click ID. Required for offline conversions. |
| Campaign name | `campaign_name` | `{campaign_name}` | `{trackingField1}` | The Yandex Direct campaign name |
| Campaign type | `campaign_type` | `{campaign_type}` | `{trackingField2}` | The campaign type code, for example `type1` for a unified performance campaign |
| Ad ID | `ad_id` | `{ad_id}` | `{trackingField3}` | The ad |
| Creative ID | `creative_id` | `{creative_id}` | `{trackingField4}` | The creative from Yandex's Ad Builder. Empty for plain text ads. |
| keyword | `keyword` | `{keyword}` | `{trackingField5}` | The keyword that triggered the ad |
| source | `source` | `{source}` | `{trackingField6}` | The placement: the partner site's domain on the Advertising Network, `none` on Yandex search |
| Source type | `source_type` | `{source_type}` | `{trackingField7}` | `search` or `context` (an Advertising Network site) |
| Match type | `match_type` | `{match_type}` | `{trackingField8}` | How the impression matched: `rm` for autotargeting, `syn` for semantic matching |
| Position | `position` | `{position}` | `{trackingField9}` | The ad's exact position in its block. `0` on the Advertising Network. |

![The Yandex template's Parameters table in ClickFlare, with Yandex's macros pre-filled](https://mintcdn.com/clickflare/Z7FseNUODe2P_cAH/images/integrations/templates/yandex/parameters.png?fit=max\&auto=format\&n=Z7FseNUODe2P_cAH\&q=85\&s=ac054292addf02f1a2914a80a265152e)

Each tracking field becomes a column you can group reports by. On the Advertising Network, `source` shows which partner sites convert, so you can exclude the rest. On search, `keyword` and `position` show which queries pay.

The template has no campaign ID row, and names can change, so the ID is the safer key for matching data with Yandex Direct. To add it and other useful data, click **Add Parameter**, give it a name and parameter, and enter the Yandex dynamic parameter as the **TS Token**. ClickFlare assigns the next free tracking field.

| Add this | TS Parameter | TS Token |
| - | - | - |
| Campaign ID | `campaign_id` | `{campaign_id}` |
| Ad group ID | `gbid` | `{gbid}` |
| Device type | `device_type` | `{device_type}` |
| Region | `region_name` | `{region_name}` |
| Position type | `position_type` | `{position_type}` |

> [!WARNING]
>
> Don't change or remove the `externalId` row. It is the only place ClickFlare gets the Yandex click ID. Without `yclid`, you can't build an offline conversion file, and Yandex can't tie your conversions to its clicks.

## Step 2 – Send conversions to Yandex

Yandex Direct does not accept S2S postback URLs. That is why the template has no postback, and why **Traffic source postback URL** stays off on this traffic source. Yandex Direct learns about conversions from Yandex Metrica goals. There are two ways to get a conversion into Metrica. You can use both.

### Option A: Offline conversion upload, matched on yclid (works with any offer)

This sends ClickFlare's conversions to Metrica as a file. Metrica matches each row to the ad click through its `yclid`. It works when the conversion happens on a site you don't control, such as an affiliate offer.

1. **Create the goal in Metrica.** On the **Goals** page of your Metrica tag, create a goal of the **JavaScript event** type, for example with the identifier `order_confirmed`. Metrica only accepts offline conversions for JavaScript event goals.
2. **Collect the conversions from ClickFlare.** For each conversion you need three values: the **External ID** (the `yclid`), the conversion time, and, if you want to pass revenue, the payout. Pull them from ClickFlare's reports for the campaign, with the External ID as a column, and export them with **Download CSV**.
3. **Build the file.** Metrica's offline conversion file is a UTF-8 CSV with these columns:

| Column | Required | What goes in it |
| - | - | - |
| `Yclid` | Yes | The External ID ClickFlare stored for the converting visit |
| `Target` | Yes | The goal identifier from step 1, for example `order_confirmed` |
| `DateTime` | Yes | The conversion time as a Unix timestamp in seconds. Account for your Metrica tag's time zone. It must be in the past. |
| `Price` | No | The payout, with a period as the decimal separator |
| `Currency` | No | A three-letter currency code, for example `RUB` or `USD` |

A row looks like this:

```text theme={null}
Yclid,Target,DateTime,Price,Currency
2386341785837920255,order_confirmed,1761210000,12.50,USD
```

4. **Upload it.** In Metrica, open **Settings** and the **Upload data** tab. In **Upload offline conversions**, click **Upload data**, select **Yclid** as the linking type, choose your file and click **Upload data**.
5. **Check the match.** The conversions show in Metrica reports within a few hours. The **Offline conversions** report shows how many rows Metrica matched.

> [!WARNING]
>
> Metrica only accepts a conversion if no more than 21 days have passed between the visitor's last session and the moment the file is processed. Upload at least weekly, and daily if Yandex Direct bids on this goal. A conversion that arrives late is lost to Yandex, even though ClickFlare still counts it.

A `yclid` row is credited to the session that started from the Yandex ad. That session has to exist in Metrica, which means the Metrica tag must load on your lander with `yclid` in its URL. See [Keep yclid on your lander](#keep-yclid-on-your-lander) below.

Metrica also offers the same upload as an API: a `POST` to `/management/v1/counter/{counterId}/offline_conversions/upload` with an OAuth token. ClickFlare's traffic source postback sends a simple URL request, so it can't call this API. To automate the upload, run a script on your side that pulls conversions from ClickFlare and sends them to Metrica.

### Option B: Metrica goals on pages you control

If the conversion happens on your own site (your store, your lead form, your thank-you page), install the Metrica tag there and set up a goal for the conversion page or event in Metrica. The tag records the conversion in the visitor's browser, in real time, with no upload.

Conversions on an affiliate offer's site never load your tag. For those, use Option A.

### Keep yclid on your lander

Metrica ties a session to a Yandex Direct click through the `yclid` in the page URL. With **Redirect** tracking, Yandex sends the click to ClickFlare, and ClickFlare redirects to your lander. The lander URL doesn't carry `yclid` unless you add it.

Add it with ClickFlare's External ID token at the end of your lander's URL in ClickFlare:

```text theme={null}
https://your-lander.com/page?yclid={external_id}
```

ClickFlare replaces `{external_id}` with the stored `yclid` on each visit. The Metrica tag on the lander then sees the same click ID Yandex gave. Both options above depend on this.

With **Direct** tracking, the visitor lands on your lander straight from Yandex, so `yclid` is already in the URL. See [Direct Campaign Tracking](/docs/en/campaigns/direct-campaign-tracking.md).

## Step 3 – Finish the campaign and copy its URL

1. Name the campaign.
2. Set the **Cost Model** to **CPC** and enter your average cost per click from Yandex Direct. See [Cost](#cost).
3. Choose **Redirect** or **Direct** tracking. Redirect works for every setup. Choose Direct if Yandex moderation needs the ad link to point at your lander's domain.
4. Leave **Disable sending postbacks to traffic source** as it is. The Yandex traffic source has no postback, so nothing is sent either way.
5. Click **Next** and, on **Destination**, add your lander (with `yclid={external_id}` in its URL, as above) and your offer.
6. Save, open **Tracking**, select your own tracking domain and copy the **campaign URL**.

The campaign URL already contains every Yandex dynamic parameter from the template, for example `yclid={yclid}` and `source={source}`.

If you use a lander, its call-to-action must link to the ClickFlare **click URL**, not to the offer directly. Otherwise the visit reaches the offer without a ClickFlare click ID, the conversion can't be traced back to its `yclid`, and it can't go into your Metrica file.

See [Creating a Campaign in ClickFlare](/docs/en/campaigns/creating-a-campaign-in-click-flare.md).

## Step 4 – Create the campaign in Yandex Direct

1. In Yandex Direct, create a campaign and its ad groups as usual.
2. Paste the ClickFlare campaign URL into each ad's link.
3. Link your Metrica tag to the campaign and choose the goal from Step 2 as the conversion goal Yandex Direct should optimize for.
4. Submit the ads for moderation.

Paste the URL exactly as ClickFlare gives it. Yandex replaces each `{...}` dynamic parameter when the ad is clicked. If an ad already has its own tracking parameters, check that `yclid` appears only once in the final link.

## Step 5 – Test the integration

Yandex has no postback test, so test each half separately.

1. **The click.** Open your campaign URL in a browser and replace `{yclid}` with a test value, for example `yclid=test123`. In ClickFlare, find the visit and check that its External ID is `test123`.
2. **The lander.** On the same visit, check that the lander opened with `yclid=test123` in its address bar. If it didn't, the `yclid={external_id}` part is missing from the lander URL.
3. **The conversion.** Complete the offer the way a real visitor would. The conversion should appear in ClickFlare against that visit.
4. **The upload.** After your first real conversions, upload a small file and check the **Offline conversions** report in Metrica. Rows that don't match usually have a mistyped `yclid` or a session older than 21 days.

***

## Tracking several events

Each Metrica goal is one event. To send a lead and a sale separately:

1. In ClickFlare, create a [custom conversion](/docs/en/settings/custom-conversions.md) for each step, for example `lead` and `purchase`.
2. In Metrica, create a JavaScript event goal for each, for example `lead` and `purchase`.
3. In your upload file, put each conversion's goal identifier in the `Target` column. One file can hold several goals.
4. In Yandex Direct, choose which goal the campaign optimizes for.

> **Sending only one event**
>
> If Yandex should only learn from your final sale, upload only rows for that custom conversion. Earlier steps (leads, add to carts) still show in ClickFlare. They just don't reach Yandex.

## Cost

The template has no cost row, and Yandex Direct has no dynamic parameter for the price of a click. ClickFlare can't read cost from the URL.

Set the campaign's **Cost Model** to **CPC** and enter your average cost per click from Yandex Direct. Check the average CPC in Yandex Direct after a few days and update it.

When the recorded spend differs from your Yandex Direct spend, correct it with a [manual cost upload](/docs/en/settings/manual-cost-upload.md). If you added the `campaign_id` row, you can match the upload to Yandex Direct's spend report by campaign. See [Cost Models](/docs/en/core-platform-concepts/cost-models.md).

## Delayed revenue

Revenue that arrives late (search arbitrage feeds, approved leads) simply goes into your next upload file with the final payout in `Price`, inside the 21-day window. For the general approach, see [Sending Delayed Revenue to Traffic Sources](/docs/en/advanced-tracking-configuration/how-to-send-delayed-revenue-to-traffic-sources.md).

***

## Troubleshooting

> **External ID is empty in ClickFlare**
>
> * The campaign URL in Yandex Direct is missing `yclid={yclid}`, or the dynamic parameter was edited. Copy the URL from ClickFlare again.
> * The `externalId` row was removed from the traffic source.
> * The URL was opened outside a real Yandex click, for example in moderation or a preview, where the dynamic parameter isn't replaced.

> **Metrica doesn't match the uploaded conversions**
>
> * The lander URL doesn't pass `yclid={external_id}`, so Metrica never recorded the session that started from the ad.
> * The Metrica tag isn't on the lander, or it loads after the visitor has left.
> * More than 21 days passed between the session and the upload.
> * `DateTime` is in milliseconds, in the future, or ignores the tag's time zone.
> * The goal in `Target` isn't a JavaScript event goal.

> **Yandex Direct shows no conversions**
>
> * The Metrica tag isn't linked to the Yandex Direct campaign, or the campaign doesn't use the goal you upload to.
> * The upload hasn't been processed yet. Allow a few hours.
> * Check the **Offline conversions** report in Metrica first. If Metrica shows the conversions, the gap is in the Yandex Direct campaign settings.

> **Source or keyword columns are empty**
>
> Yandex only fills each dynamic parameter where it applies. `keyword` and `position` are empty or `0` on the Advertising Network, and `source` is `none` on Yandex search. If every value is empty, the URL was edited or pasted somewhere Yandex doesn't process parameters. See [Traffic Source Tokens Arriving Empty](/docs/en/troubleshooting/tokens-arriving-empty.md).

For the general checklist, see [Conversions not showing](/docs/en/troubleshooting/conversions-not-showing.md).

***

**FREQUENTLY ASKED QUESTIONS**

> **Q1:** Can ClickFlare send conversions to Yandex automatically?

**A1:** Not with a postback. Yandex Direct has no postback URL, and Metrica's upload API needs an OAuth token and a file in a `POST` request, which a traffic source postback can't send. Upload files by hand, automate the upload with your own script, or record conversions with the Metrica tag on pages you control.

> **Q2:** Why do I need `yclid` on my lander if ClickFlare already stores it?

**A2:** ClickFlare stores it for its own reports and for your upload file. Metrica can only credit a `yclid` to a session it saw, and it sees the session through its tag on your lander. Without `yclid` in the lander URL, the session looks like ordinary traffic and the uploaded row doesn't match.

> **Q3:** Should I use Redirect or Direct tracking with Yandex?

**A3:** Both work. Redirect is simpler to set up. Direct keeps `yclid` on the lander without extra steps, and lets Yandex moderation see your lander's domain in the ad link. See [Direct Campaign Tracking](/docs/en/campaigns/direct-campaign-tracking.md).

> **Q4:** Does Yandex use the payout I upload?

**A4:** Metrica stores `Price` and `Currency` as the goal's value. Whether Yandex Direct bids on that value depends on the campaign's strategy. Upload it anyway, so Metrica's reports show revenue per campaign.

## Related

> **[Direct campaign tracking](/docs/en/campaigns/direct-campaign-tracking.md)**
>
> Send Yandex clicks straight to your lander.

> **[Custom conversions](/docs/en/settings/custom-conversions.md)**
>
> Split leads and sales into separate events.

> **[Manual cost upload](/docs/en/settings/manual-cost-upload.md)**
>
> Correct spend with Yandex Direct's own figures.

> **[Conversions not showing](/docs/en/troubleshooting/conversions-not-showing.md)**
>
> The general checklist when conversions don't arrive.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.