> For the complete documentation index, see [llms.txt](https://docs.flip.to/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flip.to/docs/integrations/advertising/ad-data-sftp.md).

# Send ad data to Flip.to

Use SFTP to send your ad data to Flip.to each day. Send a **performance file** for ad results and a separate **clicks file** for Google click IDs.

## Set up your delivery

{% stepper %}
{% step %}

### Get access

Send Flip.to:

* The public IP addresses your uploads will come from
* Your SSH public key

The server only accepts connections from approved IP addresses. Wait for Flip.to to confirm that access is ready.

If you need a new key pair, run:

```sh
ssh-keygen -t ed25519 -f flipto_sftp
```

{% hint style="warning" %}
Send only `flipto_sftp.pub`. Keep `flipto_sftp` private, like a password.
{% endhint %}
{% endstep %}

{% step %}

### Connect

Use the host, port, username and upload folder in your setup email from Flip.to. Sign in with your SSH key; no password or email address is needed.

On your first connection, check the server's host-key fingerprint against the fingerprints in that email.
{% endstep %}

{% step %}

### Test an upload

Upload a file whose name starts with `test_`. These files are ignored during processing.

You can list and upload files. You cannot download, overwrite, rename, delete, or create folders.

Turn off any setting that uploads to a temporary name and then renames the file. Each file can be up to **200 MiB**.
{% endstep %}

{% step %}

### Send files daily

Include the **last 7 complete days** in each delivery. This lets later deliveries include late bookings.

Delivery around midnight is preferred. The server may restart for updates around **17:00 UTC** each day. Tell Flip.to if your delivery schedule overlaps with that time.

Use these names, with the UTC time when you generated the file:

{% code title="Daily filenames (UTC generation time)" %}

```
performance_YYYYMMDDTHHMMSSZ.csv
clicks_YYYYMMDDTHHMMSSZ.csv
```

{% endcode %}

Every filename must be unique. A later performance file replaces earlier data for the same ad and date; it does not overwrite the uploaded file.
{% endstep %}
{% endstepper %}

## File reference

{% hint style="info" %}
**Include every required column.** Only optional columns may be left out. Use the rules and columns below to prepare your files.
{% endhint %}

<details>

<summary>File rules</summary>

* Use CSV with UTF-8 encoding.
* Use `YYYY-MM-DD` dates in the ad account's time zone.
* Include complete days only.
* Use plain numbers with `.` as the decimal point. Do not include currency symbols or thousands separators.
* Put required columns first, in the exact order below.
* Add optional columns afterward in any order. Leave out optional columns you do not have.
* Match column names exactly, including capitalization. Unlisted column names are rejected.

If any row is invalid, the whole file is rejected. Flip.to will contact you with the reason.

</details>

<details>

<summary>Performance file columns</summary>

Rows are added together for each `Ad_Id` and `Date`. Do not include total rows.

### Required columns

Include all 20 columns, in this order:

{% code title="Required performance header (exact order)" %}

```csv
Date,Property_Name,Channel,Reporting_Platform,Device,Campaign,Adgroup,Placement,Creative,Ad,Keyword,Bid_Currency,Impressions,Clicks,Media_Spend,Bookings,Revenue,Campaign_Id,Adgroup_Id,Ad_Id
```

{% endcode %}

Always fill in:

* `Date`, `Property_Name`, `Channel`, `Reporting_Platform`
* `Campaign`, `Bid_Currency`, `Campaign_Id`, `Ad_Id`
* `Impressions`, `Clicks`, `Media_Spend`, `Bookings`, `Revenue`

Use `0` for those five numeric fields when there is no value.

These columns must be present, but their values may be blank:

`Device`, `Adgroup`, `Placement`, `Creative`, `Ad`, `Keyword`, `Adgroup_Id`

### Names and IDs

* Use the `Property_Name` value agreed with Flip.to and included in your setup email.
* Use `Google Ads` for Google Ads rows in `Reporting_Platform`.
* Use your channel names, such as `Paid Search` or `Display`.
* `Bid_Currency` is the currency used for both spend and revenue.
* `Campaign`, `Adgroup`, and `Ad` contain names. Put their IDs in the matching `_Id` columns.
* For Google Ads, `Campaign_Id` is `campaign.id` and `Ad_Id` is `ad_group_ad.ad.id`.
* For campaign-level types such as Performance Max, use the campaign ID as `Ad_Id` and leave `Adgroup_Id` blank.
* For other platforms, use their own IDs and channel names. Tell Flip.to which `Reporting_Platform` values you will send.

### Optional columns

The most useful optional columns are:

| Column                    | What to send                                                                                       |
| ------------------------- | -------------------------------------------------------------------------------------------------- |
| `Campaign_Type`           | Google's `advertising_channel_type`, such as `SEARCH`, `HOTEL`, `PERFORMANCE_MAX`, or `DEMAND_GEN` |
| `Interactions`            | The platform's interactions count                                                                  |
| `Ad_Type`                 | Google's `ad_group_ad.ad.type`                                                                     |
| `Final_Url`               | The landing page URL                                                                               |
| `Image_Url`               | The ad's image URL, if it has one                                                                  |
| `Hotel_Center_Id`         | The campaign's `hotel_setting.hotel_center_id`                                                     |
| `Account_Hotel_Center_Id` | The Hotel Center linked to the account                                                             |

Separate multiple URLs in `Final_Url` with `|`.

You can also include:

* `Conversions`, `Unique_Clicks`, `Landing_Page_Views`
* `Ad_Status`, `Campaign_Status`, `Adgroup_Status`: use the platform's own status text
* `Headlines`: separate headlines with `|`
* `Campaign_Start_Date`, `Campaign_End_Date`: use `YYYY-MM-DD`, or leave blank if there is no date
* `Campaign_Budget`: the daily budget in `Bid_Currency` units, not micros
* `Bidding_Strategy`: the strategy type, such as `TARGET_ROAS`
* `Target_Roas`: a ratio, such as `4.0`
* `Target_Cpa`: in `Bid_Currency` units, not micros
* `Campaign_Sub_Category`: Google's `advertising_channel_sub_type`

Repeat the same ad, campaign, and ad-group attributes on every row for that ad.

`Device`, `Placement`, `Keyword`, and `Creative` are accepted, but are not kept after rows are added together.

</details>

<details>

<summary>Google clicks file columns</summary>

Send one row per click. Put GCLIDs here, separate from the performance file.

### Required columns

Include these four columns first, in this order:

{% code title="Required clicks header (exact order)" %}

```csv
Date,Click_Id,Ad_Id,Campaign_Id
```

{% endcode %}

* `Date`: the date of the click, not the delivery date
* `Click_Id`: the GCLID; the same GCLID must not appear on different dates
* `Ad_Id` and `Campaign_Id`: the same IDs used in the performance file

In Google's `click_view`, the ad ID is the number after `~` in `ad_group_ad`.

### Optional columns

* `Keyword`
* `City_Of_Interest`
* `Country_Of_Interest`
* `City_Location_Of_Presence`
* `Country_Location_Of_Presence`

For location columns, use the numeric geo target ID. For example, use `1023191` from `geoTargetConstants/1023191`.

</details>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.flip.to/docs/integrations/advertising/ad-data-sftp.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
