> For the complete documentation index, see [llms.txt](https://docs.hockeystack.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hockeystack.com/integrations/datasyncs/configure-a-datasync-import/setting-up-your-data-for-import/import-sync-spend.md).

# Import Sync Spend

This is a specialized version of the Metadata import below and is available for all customers regardless of them having Data Syncs enabled or not. We suggest you use this option if you are specifically looking to import spend data into HockeyStack since it can behave differently than other data points.

## Example Schema

Each row has a timestamp and the combination of campaign, ad group, ad, and UTM information.

<table data-full-width="true"><thead><tr><th width="181.75390625">Column Name</th><th width="165.95703125">Example Value</th><th width="153.34765625">Requirement<select><option value="J7HQWGSO4Dna" label="required" color="blue"></option><option value="RK5EASp0s6Tw" label="recommended" color="blue"></option><option value="HxLQ7fLgioTx" label="optional" color="blue"></option></select></th><th>Description</th></tr></thead><tbody><tr><td>date</td><td>2025-03-18</td><td><span data-option="J7HQWGSO4Dna">required</span></td><td>The date of the campaign / ad metric</td></tr><tr><td>campaign_name</td><td>SaaStr Booth</td><td><span data-option="J7HQWGSO4Dna">required</span></td><td>Name of your campaign</td></tr><tr><td>spend</td><td>45300.16</td><td><span data-option="J7HQWGSO4Dna">required</span></td><td>Numerical value of spend without a currency symbol, or commas</td></tr><tr><td>currency</td><td>USD</td><td><span data-option="HxLQ7fLgioTx">optional</span></td><td>Recommended if ingesting spend data. Three letter currency code</td></tr><tr><td>network</td><td>Field Marketing</td><td><span data-option="RK5EASp0s6Tw">recommended</span></td><td>Campaign or ad network to group the metrics by (i.e. Google Ads is also an ad network)</td></tr><tr><td>utm_campaign</td><td>saastr-booth-cm</td><td><span data-option="RK5EASp0s6Tw">recommended</span></td><td>Not required, but very helpful when included to be able to connect this to website pageviews</td></tr><tr><td>campaign_id</td><td>19928</td><td><span data-option="RK5EASp0s6Tw">recommended</span></td><td>ID of your campaign</td></tr><tr><td>adgroup_id</td><td>9898129</td><td><span data-option="HxLQ7fLgioTx">optional</span></td><td>ID of your Ad Group</td></tr><tr><td>adgroup_name</td><td>Retargeting F24</td><td><span data-option="HxLQ7fLgioTx">optional</span></td><td>Name of your Ad Group</td></tr><tr><td>account_id</td><td>001FKQN2DJA5</td><td><span data-option="HxLQ7fLgioTx">optional</span></td><td>ID from CRM</td></tr><tr><td>impressions</td><td>95380</td><td><span data-option="HxLQ7fLgioTx">optional</span></td><td>Numerical value of impressions, without commas</td></tr><tr><td>clicks</td><td>3318</td><td><span data-option="HxLQ7fLgioTx">optional</span></td><td>Numerical value of clicks, without commas</td></tr><tr><td>url</td><td>www.testurl.com/?open-page</td><td><span data-option="HxLQ7fLgioTx">optional</span></td><td>Page URL of campaign</td></tr></tbody></table>

{% hint style="info" %}
**Important:**\
Although `spend`, `impressions` and `clicks` by themselves are not required, it is mandatory to include at least one of them to be able to measure it as metrics.
{% endhint %}

## How to Connect&#x20;

To get started, navigate to [Atlas > Ingest > Custom Data Source](https://hockeystack.com/dashboard/settings?tab=1).

1. Select **Google Sheets** as the Data Source&#x20;

{% hint style="info" %}
If you have the **Data Syncs** feature, you can select other Data Source destinations (ex. BigQuery, Snowflake, S3)&#x20;
{% endhint %}

2. Configure the Sync settings

* **Name**
* **Import Type:** Custom Spend&#x20;
* **Schedule Options:** One-time or Recurring (daily)&#x20;
* **Connection Details**: Public (legacy) or Private (recommended)

3. Create the data source&#x20;

* Copy our Google Sheets template to start populating it: [HockeyStack Template - Sync Spend](https://docs.google.com/spreadsheets/d/16NHBul2BAU1sLilmZFtGFSMnm3zTTvCqli6S5zrhfC0/edit?usp=sharing)
  * **The yellow marked columns are required.**
  * If you need to use a different currency, you can do the following:

<figure><img src="/files/9gAnhVKFn8ARrTI7wkpt" alt=""><figcaption></figcaption></figure>

* Public sheets (legacy) require at least one UTM parameter to be included.&#x20;

4. Connecting the sheet
   1. **Private** (recommended)
      1. Once the sheet has been created, share the sheet with `hockeystack-sync-spend-import@sync-spend.iam.gserviceaccount.com`
      2. Copy the URL (top search bar) and paste it into HockeyStack
   2. **Public** (legacy)
      1. Click File on the top left, hover over Share, and select Publish to Web<br>

         <figure><img src="/files/VyqvvV5rUTiMck2CFPm5" alt=""><figcaption></figcaption></figure>

         \
         On the screen that comes up, change “Web page” to “CSV”, and click Publish<br>

         <figure><img src="/files/WpWNBuksa460lJ4vN7eX" alt=""><figcaption></figcaption></figure>

         \
         Then, copy this URL, and add it into HockeyStack&#x20;
5. Click Test Connection. Once successful, click it again to create the sync&#x20;

<figure><img src="/files/gjpEuL093iiG9puagmJq" alt="" width="563"><figcaption></figcaption></figure>

6. Configure Ingestion Settings &#x20;

* For small files (< 10K rows) select "Changes to the same object overwrite existing rows"&#x20;

  * For larger files select "Changes to same object are new rows"

  <div data-gb-custom-block data-tag="hint" data-style="warning" class="hint hint-warning"><p>For "New Rows", an <code>updatedAt</code> date column is required. </p></div>
* Map the ingestion date column (used to organize data sequentially)

<figure><img src="/files/QPBFmOVssrZerooAOxZm" alt=""><figcaption></figcaption></figure>

* Map remaining columns
  * **Note:** UTMs (Source, Medium, etc) are automatically mapped— no action needed&#x20;

7. Create Connection&#x20;

* Syncs are paused by default. Click on the connection in Atlas and start the sync with the lightning icon

<figure><img src="/files/MdjcAItXk1VaB5XogkKj" alt=""><figcaption></figcaption></figure>


---

# 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 dynamically by asking a question.

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

```
GET https://docs.hockeystack.com/integrations/datasyncs/configure-a-datasync-import/setting-up-your-data-for-import/import-sync-spend.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
