# Snapchat Marketing

## Pipeline Concepts

Before setting up the Pipeline, learn about Pipeline concepts [here](https://docs.sprinkledata.com/product/ingesting-your-data/pipelines)

## Step by Step Guide

### STEP-1: Configure Connection

To learn about Connection, refer [here](https://docs.sprinkledata.com/product/ingesting-your-data/pipelines)

* Log into Sprinkle application
* Navigate to Ingest -> Connections Tab -> New Connection ->&#x20;
* Select Snapchat Marketing
* Provide all the mandatory details
  * *Name*: Name to identify this connection
  * *Advance Setting* : Refer [here](#advanced-connection-settings)
* Connect to Snapchat&#x20;
* Test Connection&#x20;
* Create

### STEP-2: Configure Pipeline

To learn about Pipeline, refer [here](https://docs.sprinkledata.com/product/ingesting-your-data/pipelines)

* Navigate to Ingest -> Pipeline Tab -> Add ->&#x20;
* Select Snapchat Marketing
* Provide the name -> Create
* **Connection Tab**:&#x20;
  * From the drop-down, select the name of connection created in STEP-2
  * Update

### STEP-3: Create Dataset

**Datasets Tab**: To learn about Dataset, refer [here](https://docs.sprinkledata.com/product/ingesting-your-data/pipelines). Add Dataset for each report/dataset that you want to integrate, providing following details

* *Org Id* (Required): Select from the drop-down
  * *Account Id (Required) :* Select from the drop-down
  * *Report Type* (Required): Select from the drop-down
* *Destination Schema* (Required) : Data warehouse schema where the table will be ingested into
* Flatten Level(Required) : Select One Level or Multi Level. In one level, flattening will not be applied on complex type. They will be stored as string. In multi level, flattening will be applied in complex level till they become simple type.
* *Destination Table name* (Required) : It is the table name to be created on the warehouse. If not given, sprinkle will create like ds\_\<Pipelinename>\_\<tablename>
* *Destination Create Table Clause*: Provide additional clauses to warehouse-create table queries such as clustering, partitioning, and more, useful for optimizing DML statements. [Learn more](https://docs.sprinkledata.com/product/ingesting-your-data/pipelines/databases/features/destination-create-table-clause) on how to use this field.
* Create

### STEP-4: Run and schedule Ingestion

In the **Ingestion Jobs** ta&#x62;**:**

* Trigger the Job, using Run button
* To schedule, enable Auto-Run. Change the frequency if needed

## Advanced Connection Settings

* **API Read Timeout (In seconds) :**   Maximum time of inactivity between two data packets when waiting for the server's response. The default value is 30 seconds.
* **API Connection Timeout (In seconds) :**  Time period within which a connection between a client and a server must be established.&#x20;
* **Retry Limit :** Number of retries allowed when an API call fails. For example if an API call fails and retry limit is 5 then it will check 5 times for that API call and if it succeeded then it will stop checkin&#x67;**.**
* **Retry Sleep Time (In milliseconds) :** Given time, after which retry should happen in case an API call fails.
* **Version :** It gives information about the version of Snapchat Marketing API being used.
* **Incremental Batch Size (In days) :** No. of days in one batch for which data is being downloaded during incremental ingestion.

## Dataset Fields

<details>

<summary>Ads</summary>

* ad\_squad\_id&#x20;
* creative\_id&#x20;
* name&#x20;
* paying\_advertiser\_name&#x20;
* review\_status&#x20;
* review\_status\_reasons&#x20;
* status&#x20;
* type&#x20;
* delivery\_status&#x20;
* deleted

</details>

<details>

<summary>Ads Account</summary>

* sub\_request\_status&#x20;
* adaccount\_id&#x20;
* adaccount\_updated\_at&#x20;
* adaccount\_created\_at&#x20;
* adaccount\_name&#x20;
* adaccount\_type&#x20;
* adaccount\_status&#x20;
* adaccount\_organization\_id&#x20;
* adaccount\_currency&#x20;
* adaccount\_timezone&#x20;
* adaccount\_advertiser\_organization\_id&#x20;
* adaccount\_billing\_center\_id&#x20;
* adaccount\_billing\_type&#x20;
* adaccount\_agency\_representing\_client&#x20;
* adaccount\_client\_paying\_invoices&#x20;
* adaccount\_agency\_client\_metadata&#x20;
* adaccount\_regulations\_restricted\_delivery\_signals

</details>

<details>

<summary>Ad Account Stats</summary>

* sprinkle\_ingestion\_date&#x20;
* sub\_request\_status&#x20;
* total\_stat\_id&#x20;
* total\_stat\_type&#x20;
* total\_stat\_granularity&#x20;
* total\_stat\_stats\_spend&#x20;
* total\_stat\_start\_time&#x20;
* total\_stat\_end\_time&#x20;
* total\_stat\_finalized\_data\_end\_time

</details>

<details>

<summary>Ad Squads</summary>

* campaign\_id&#x20;
* bid\_micro&#x20;
* billing\_event&#x20;
* child\_ad\_type&#x20;
* forced\_view\_setting&#x20;
* daily\_budget\_micro&#x20;
* lifetime\_budget\_micro&#x20;
* end\_time&#x20;
* name&#x20;
* optimization\_goal&#x20;
* placement\_v2&#x20;
* start\_time&#x20;
* status&#x20;
* story\_ad\_creative\_type&#x20;
* targeting type&#x20;
* included\_content\_types&#x20;
* excluded\_content\_types&#x20;
* cap\_and\_exclusion\_config&#x20;
* ad\_scheduling\_config&#x20;
* auto\_bid&#x20;
* target\_bid&#x20;
* bid\_strategy&#x20;
* roas\_value\_micro&#x20;
* pixel\_id&#x20;
* measurement\_provider\_names&#x20;
* delivery\_constraint&#x20;
* reach\_and\_frequency\_status&#x20;
* reach\_goal impression\_goal&#x20;
* pacing\_type&#x20;
* delivery\_status event\_sources&#x20;
* skadnetwork\_properties.status&#x20;
* deleted&#x20;
* separated\_types

</details>

<details>

<summary>Billing Centers</summary>

* sub\_request\_status&#x20;
* billingcenter\_id&#x20;
* billingcenter\_updated\_at&#x20;
* billingcenter\_created\_at&#x20;
* billingcenter\_organization\_id&#x20;
* billingcenter\_name&#x20;
* billingcenter\_email\_address&#x20;
* billingcenter\_country

</details>

<details>

<summary>Campaigns</summary>

* ad\_account\_id&#x20;
* daily\_budget\_micro&#x20;
* end\_time&#x20;
* name&#x20;
* start\_time&#x20;
* status&#x20;
* lifetime\_spend\_cap\_micro&#x20;
* measurement\_spec&#x20;
* objective&#x20;
* buy\_model&#x20;
* regulations&#x20;
* delivery\_status&#x20;
* deleted

</details>

<details>

<summary>Catalogs</summary>

* sub\_request\_status&#x20;
* catalog\_created\_at&#x20;
* catalog\_updated\_at catalog\_id&#x20;
* catalog\_name&#x20;
* catalog\_organization\_id&#x20;
* catalog\_source&#x20;
* catalog\_default\_product\_set\_id&#x20;
* catalog\_vertical&#x20;
* catalog\_settings\_commerce\_settings\_native\_checkout\_eligibility

</details>

<details>

<summary>Creatives</summary>

* ad\_account\_id&#x20;
* brand\_name&#x20;
* call\_to\_action&#x20;
* headline&#x20;
* shareable&#x20;
* name&#x20;
* top\_snap\_media\_id&#x20;
* top\_snap\_crop\_position&#x20;
* type&#x20;
* forced\_view\_eligibility&#x20;
* preview\_creative\_id&#x20;
* playback\_type&#x20;
* ad\_product

</details>

<details>

<summary>Demographics by Advanced Demographics</summary>

* sub\_request\_status&#x20;
* advanced\_demographics\_id&#x20;
* advanced\_demographics\_name&#x20;
* advanced\_demographics\_path&#x20;
* advanced\_demographics\_source&#x20;
* advanced\_demographics\_type&#x20;
* advanced\_demographics\_parentid&#x20;
* advanced\_demographics\_ishec

</details>

<details>

<summary>Demographics by Age Group Tables</summary>

* sub\_request\_status&#x20;
* age\_group\_id&#x20;
* age\_group\_name

</details>

<details>

<summary>Demographics by Gender</summary>

* sub\_request\_status&#x20;
* gender\_id&#x20;
* gender\_name

</details>

<details>

<summary>Demographics by Language</summary>

* sub\_request\_status&#x20;
* languages\_name&#x20;
* languages\_id

</details>

<details>

<summary>Device by Carrier</summary>

* sub\_request\_status&#x20;
* carrier\_valid\_country&#x20;
* carrier\_name&#x20;
* carrier\_id

</details>

<details>

<summary>Device by Connection Type</summary>

* sub\_request\_status&#x20;
* connection\_type\_id&#x20;
* connection\_type\_name

</details>

<details>

<summary>Device by Marketing Name</summary>

* sub\_request\_status&#x20;
* marketing\_name\_name&#x20;
* marketing\_name\_id

</details>

<details>

<summary>Device by OS Type</summary>

* sub\_request\_status&#x20;
* os\_type\_id&#x20;
* os\_type\_name

</details>

<details>

<summary>Geolocation</summary>

* sub\_request\_status&#x20;
* country\_continent\_id&#x20;
* country\_continent\_name&#x20;
* country\_country\_id&#x20;
* country\_country\_name&#x20;
* country\_country\_code&#x20;
* country\_country\_code2&#x20;
* country\_lat&#x20;
* country\_lng

</details>

<details>

<summary>Interests</summary>

* sub\_request\_status&#x20;
* scls\_id&#x20;
* scls\_name&#x20;
* scls\_path&#x20;
* scls\_parent\_id&#x20;
* scls\_source

</details>

<details>

<summary>Invoices</summary>

* org\_id&#x20;
* invoice\_id&#x20;
* netsuite\_file\_id&#x20;
* ad\_account\_id&#x20;
* customer.name&#x20;
* customer.netsuite\_id&#x20;
* document\_number&#x20;
* line\_last\_modified&#x20;
* last\_modified&#x20;
* amount\_cent&#x20;
* currency&#x20;
* billing\_period&#x20;
* due\_date&#x20;
* created\_at&#x20;
* invoice\_status&#x20;
* invoice\_content

</details>

<details>

<summary>Location</summary>

* sub\_request\_status&#x20;
* categories\_loi\_id&#x20;
* categories\_loi\_name&#x20;
* categories\_loi\_path&#x20;
* categories\_loi\_source&#x20;
* categories\_loi\_parent\_id

</details>

<details>

<summary>Media</summary>

* sub\_request\_status&#x20;
* media\_id&#x20;
* media\_updated\_at&#x20;
* media\_created\_at&#x20;
* media\_name&#x20;
* media\_ad\_account\_id&#x20;
* media\_type&#x20;
* media\_media\_status&#x20;
* media\_file\_name&#x20;
* media\_download\_link&#x20;
* media\_image\_metadata\_height\_px&#x20;
* media\_image\_metadata\_width\_px&#x20;
* media\_image\_metadata\_image\_format&#x20;
* media\_file\_size\_in\_bytes&#x20;
* media\_is\_demo\_media&#x20;
* media\_hash&#x20;
* media\_visibility

</details>

<details>

<summary>Members</summary>

* sub\_request\_status&#x20;
* member\_id&#x20;
* member\_updated\_at&#x20;
* member\_created\_at&#x20;
* member\_email&#x20;
* member\_organization\_id&#x20;
* member\_display\_name&#x20;
* member\_member\_status

</details>

<details>

<summary>Pixels</summary>

* sub\_request\_status&#x20;
* pixel\_id&#x20;
* pixel\_updated\_at&#x20;
* pixel\_created\_at&#x20;
* pixel\_name&#x20;
* pixel\_organization\_id&#x20;
* pixel\_ad\_account\_id&#x20;
* pixel\_status&#x20;
* pixel\_pixel\_javascript&#x20;
* pixel\_visible\_to\_0\_

</details>

<details>

<summary>Organizations</summary>

* sub\_request\_status&#x20;
* organization\_id&#x20;
* organization\_updated\_at&#x20;
* organization\_created\_at&#x20;
* organization\_name&#x20;
* organization\_country&#x20;
* organization\_contact\_name&#x20;
* organization\_contact\_email&#x20;
* organization\_contact\_phone&#x20;
* organization\_accepted\_term\_version&#x20;
* organization\_marketing\_optin&#x20;
* organization\_is\_agency&#x20;
* organization\_contact\_phone\_optin&#x20;
* organization\_type&#x20;
* organization\_state&#x20;
* organization\_business\_type&#x20;
* organization\_roles\_0\_&#x20;
* organization\_my\_display\_name&#x20;
* organization\_my\_invited\_email&#x20;
* organization\_my\_member\_id&#x20;
* organization\_createdbycaller

</details>

<details>

<summary>Roles in Adaccounts</summary>

* sub\_request\_status&#x20;
* role\_id role\_container\_kind&#x20;
* role\_container\_id&#x20;
* role\_member\_id&#x20;
* role\_ad\_account\_id
* role\_type

</details>

<details>

<summary>Roles in Organization</summary>

* sub\_request\_status&#x20;
* role\_id role\_container\_kind&#x20;
* role\_container\_id&#x20;
* role\_member\_id&#x20;
* role\_organization\_id&#x20;
* role\_type

</details>

<details>

<summary>Users</summary>

* id&#x20;
* updated\_at&#x20;
* created\_at&#x20;
* created\_by\_app\_id&#x20;
* created\_by\_user&#x20;
* last\_updated\_by\_app\_id&#x20;
* last\_updated\_by\_user&#x20;
* email&#x20;
* organization\_id&#x20;
* display\_name&#x20;
* member\_status

</details>
