> For the complete documentation index, see [llms.txt](https://help.daasity.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.daasity.com/core-concepts/data-integrations/setup-guides/digital-integrations/pinterest/integration-specifications.md).

# Integration Specifications

## Integration Overview

Pinterest is the visual discovery engine for finding ideas like recipes, home and style inspiration, and more. With billions of pins, it is a destination for many and advertisers can take advantage of that audience by creating and running paid campaigns to attract a new audience to their brand.

The Daasity Pinterest integration enables merchants to extract key metrics from campaigns on a daily basis to easily track and compare performance across various ad platforms. Data is transformed as part of Daasity's [Unified Marketing Schema (UMS) ](https://6652466.hs-sites.com/knowledge/unified-marketing-schema-ums?__hstc=110571290.3d85bbe60c919e56bc87203ae570ae34.1687752277119.1688013324637.1688015394056.10&__hssc=110571290.5.1688015394056&__hsfp=1912911101)that enables multi-platform reporting in one schema.

{% hint style="warning" %}
**Only 90 days of history available**

Pinterest exposes only the last 90 days of history in their API. We will not be able to extract data for any activity outside of that window. [(source)](https://developers.pinterest.com/docs/api/v5/#operation/ads/analytics)
{% endhint %}

## Integration Availability

This integration is available for:

* Enterprise
* Growth

## API Endpoints

The Daasity Pinterest extractor is built based on this [Pinterest API documentation](https://developers.pinterest.com/blog/2022/04/12/introducing-pinterest-api-v5/).  The following endpoints are used by Daasity to replicate data from Pinterest:

* [Ad Accounts](https://developers.pinterest.com/docs/api/v5/#operation/ad_accounts/get)
* [Ad Analytics](https://developers.pinterest.com/docs/api/v5/#operation/ads/analytics)
* [Ad Groups](https://developers.pinterest.com/docs/api/v5/#operation/ad_groups/get)
* [Ads](https://developers.pinterest.com/docs/api/v5/#operation/ads/get)
* [Campaigns](https://developers.pinterest.com/docs/api/v5/#operation/campaigns/get)

## Entity Relationship Diagram (ERD)

[Click here to view the ERD for the Daasity Pinterest integration](https://lucid.app/documents/embedded/1fab2216-393a-40f2-a742-94c4c0e094a6) illustrating the different tables and keys to join across tables.

## Pinterest Schema

The Daasity Pinterest extractor creates these tables using the endpoints and replication methods listed.  The data is mapped from the source API endpoint to the table based on the mapping logic outlined in each table.

* [Ad Accounts](#a-d-accounts)
* [Ad Analytics](#a-d-analytics)
* [Ad Groups](#a-d-groups)
* [Ads](#a-ds)
* [Campaigns](#campaigns)

### **Ad Accounts**

* Endpoint: [Ad Accounts](https://developers.pinterest.com/docs/api/v5/#operation/ad_accounts/get)
* Update Method: UPSERT
* Table Name: \[`pinterest.ad_accounts`]

| JSON Element                                                       | Database Column              |
| ------------------------------------------------------------------ | ---------------------------- |
| id                                                                 | id                           |
| name                                                               | name                         |
| owner::username                                                    | owner                        |
| country                                                            | country                      |
| currency                                                           | currency                     |
| click\_window\_days                                                | click\_window\_days          |
| engagement\_window\_days                                           | \_\_engagement\_window\_days |
| view\_window\_days                                                 | \_\_view\_window\_days       |
| conversion\_report\_time                                           | \_\_conversion\_report\_time |
| MD5(ad\_account::id + ad\_account::country +ad\_account::currency) | \_\_sync\_key                |

### **Ad Analytics**

* Endpoint: [Ad Analytics](https://developers.pinterest.com/docs/api/v5/#operation/ad_account/analytics)
* Update Method: UPSERT
* Table Name: \[`pinterest.ad_analytics`]

| JSON Element                                                         | Database Column                                       |
| -------------------------------------------------------------------- | ----------------------------------------------------- |
| ad\_account\_id                                                      | ad\_account\_id                                       |
| ad\_group\_id                                                        | ad\_group\_id                                         |
| ad\_id                                                               | ad\_id                                                |
| campaign\_id                                                         | campaign\_id                                          |
| ad\_group\_entity\_status                                            | ad\_group\_entity\_status                             |
| campaign\_daily\_spend\_cap                                          | campaign\_daily\_spend\_cap                           |
| campaign\_entity\_status                                             | campaign\_entity\_status                              |
| campaign\_name                                                       | campaign\_name                                        |
| checkout\_roas                                                       | checkout\_roas                                        |
| clickthrough\_1                                                      | clickthrough\_1                                       |
| clickthrough\_1\_gross                                               | clickthrough\_1\_gross                                |
| clickthrough\_1\_gross                                               | clickthrough\_2                                       |
| cpc\_in\_micro\_dollar                                               | cpc\_in\_micro\_dollar                                |
| cpm\_in\_dollar                                                      | cpm\_in\_dollar                                       |
| cpm\_in\_micro\_dollar                                               | cpm\_in\_micro\_dollar                                |
| ctr                                                                  | ctr                                                   |
| ctr\_2                                                               | ctr\_2                                                |
| date                                                                 | date                                                  |
| ecpcv\_in\_dollar                                                    | ecpcv\_in\_dollar                                     |
| ecpcv\_p95\_in\_dollar                                               | ecpcv\_p95\_in\_dollar                                |
| ecpc\_in\_dollar                                                     | ecpc\_in\_dollar                                      |
| ecpc\_in\_micro\_dollar                                              | ecpc\_in\_micro\_dollar                               |
| ecpe\_in\_dollar                                                     | ecpe\_in\_dollar                                      |
| ecpm\_in\_micro\_dollar                                              | ecpm\_in\_micro\_dollar                               |
| ecpv\_in\_dollar                                                     | ecpv\_in\_dollar                                      |
| ectr                                                                 | ectr                                                  |
| eengagement\_rate                                                    | eengagement\_rate                                     |
| engagement\_1                                                        | engagement\_1                                         |
| engagement\_2                                                        | engagement\_2                                         |
| engagement\_rate                                                     | engagement\_rate                                      |
| impression\_1                                                        | impression\_1                                         |
| impression\_1\_gross                                                 | impression\_1\_gross                                  |
| impression\_2                                                        | impression\_2                                         |
| page\_visit\_cost\_per\_action                                       | page\_visit\_cost\_per\_action                        |
| page\_visit\_roas                                                    | page\_visit\_roas                                     |
| page\_visit\_roas                                                    | paid\_impression                                      |
| pin\_id                                                              | pin\_id                                               |
| repin\_1                                                             | repin\_1                                              |
| repin\_2                                                             | repin\_2                                              |
| repin\_rate                                                          | repin\_rate                                           |
| spend\_in\_dollar                                                    | spend\_in\_dollar                                     |
| spend\_in\_micro\_dollar                                             | spend\_in\_micro\_dollar                              |
| total\_checkout                                                      | total\_checkout                                       |
| total\_checkout\_value\_in\_micro\_dollar                            | total\_checkout\_value\_in\_micro\_dollar             |
| total\_clickthrough                                                  | total\_clickthrough                                   |
| total\_click\_checkout                                               | total\_click\_checkout                                |
| total\_click\_checkout                                               | total\_click\_checkout\_value\_in\_micro\_dollar      |
| total\_conversions                                                   | total\_conversions                                    |
| total\_engagement                                                    | total\_engagement                                     |
| total\_engagement\_checkout                                          | total\_engagement\_checkout                           |
| total\_engagement\_checkout\_value\_in\_micro\_dollar                | total\_engagement\_checkout\_value\_in\_micro\_dollar |
| total\_engagement\_signup                                            | total\_engagement\_signup                             |
| total\_engagement\_signup\_value\_in\_micro\_dollar                  | total\_engagement\_signup\_value\_in\_micro\_dollar   |
| total\_view\_checkout                                                | total\_view\_checkout                                 |
| total\_view\_checkout\_value\_in\_micro\_dollar                      | total\_view\_checkout\_value\_in\_micro\_dollar       |
| web\_checkout\_cost\_per\_action                                     | web\_checkout\_cost\_per\_action                      |
| web\_checkout\_roas                                                  | web\_checkout\_roas                                   |
| MD5(ad\_id + ad\_group\_id + ad\_id + campaign\_id + pin\_id + date) | \_\_sync\_key                                         |

### **Ad Groups**

* Endpoint: [Ad Groups](https://developers.pinterest.com/docs/api/v5/#operation/ad_groups/get)
* Update Method: UPSERT
* Table Name: \[`pinterest.ad_groups`]

| JSON Element                                                 | Database Column                  |
| ------------------------------------------------------------ | -------------------------------- |
| id                                                           | id                               |
| ad\_account\_id                                              | ad\_account\_id                  |
| campaign\_id                                                 | campaign\_id                     |
| feed\_profile\_id                                            | feed\_profile\_id                |
| name                                                         | name                             |
| status                                                       | status                           |
| budget\_in\_micro\_currency                                  | bid\_in\_micro\_currency         |
| bid\_in\_micro\_currency                                     | bid\_in\_micro\_currency         |
| budget\_type                                                 | budget\_type                     |
| start\_time                                                  | start\_time                      |
| end\_time                                                    | end\_time                        |
| lifetime\_frequency\_cap                                     | lifetime\_frequency\_cap         |
| auto\_targeting\_enabled                                     | auto\_targeting\_enabled         |
| placement\_group                                             | placement\_group                 |
| pacing\_delivery\_type                                       | pacing\_delivery\_type           |
| conversion\_learning\_mode\_type                             | conversion\_learning\_mode\_type |
| summary\_status                                              | summary\_status                  |
| billable\_event                                              | billable\_event                  |
| type                                                         | type                             |
| updated\_time                                                | updated\_time                    |
| created\_time                                                | created\_time                    |
| MD5(id + ad\_account\_id + campaign\_id + feed\_profile\_id) | \_\_sync\_key                    |

### **Ads**

* Endpoint: [Ads](https://developers.pinterest.com/docs/api/v5/#operation/ads/get)
* Update Method: UPSERT
* Table Name: \[`pinterest.ads`]

| JSON Element                                                        | Database Column                               |
| ------------------------------------------------------------------- | --------------------------------------------- |
| id                                                                  | id                                            |
| ad\_account\_id                                                     | ad\_account\_id                               |
| campaign\_id                                                        | campaign\_id                                  |
| pin\_id                                                             | pin\_id                                       |
| ad\_group\_id                                                       | ad\_group\_id                                 |
| android\_deep\_link                                                 | android\_deep\_link                           |
| click\_tracking\_url                                                | click\_tracking\_url                          |
| creative\_type                                                      | creative\_type                                |
| destination\_url                                                    | destination\_url                              |
| ios\_deep\_link                                                     | ios\_deep\_link                               |
| is\_pin\_deleted                                                    | is\_pin\_deleted                              |
| is\_removable                                                       | is\_removable                                 |
| name                                                                | name                                          |
| status                                                              | status                                        |
| view\_tracking\_url                                                 | view\_tracking\_url                           |
| collection\_items\_destination\_url\_template                       | collection\_items\_destination\_url\_template |
| created\_time                                                       | created\_time                                 |
| review\_status                                                      | review\_status                                |
| type                                                                | type                                          |
| updated\_time                                                       | updated\_time                                 |
| summary\_status                                                     | summary\_status                               |
| MD5(id + ad\_account\_id + campaign\_id + pin\_id + ad\_agroup\_id) | \_\_sync\_key                                 |

### **Campaigns**

* Endpoint: [Campaigns](https://developers.pinterest.com/docs/api/v5/#operation/campaigns/get)
* Update Method: UPSERT
* Table Name: \[`pinterest.campaigns`]

| JSON Element                            | Database Column      |
| --------------------------------------- | -------------------- |
| id                                      | id                   |
| ad\_account\_id                         | ad\_account\_id      |
| name                                    | name                 |
| status                                  | status               |
| lifetime\_spend\_cap                    | lifetime\_spend\_cap |
| daily\_spend\_cap                       | daily\_spend\_cap    |
| order\_line\_id                         | order\_line\_id      |
| objective\_type                         | objective\_type      |
| created\_time                           | created\_time        |
| updated\_time                           | updated\_time        |
| type                                    | type                 |
| MD5(id + account\_id + order\_line\_id) | \_\_sync\_key        |
