# Taboola

Taboola is a public advertising solution.

Taboola integration replicates data using the [Taboola Backstage API](https://github.com/taboola/Backstage-API).

See the [Schema](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-Taboola-v2.htm#Schema) section for a list of objects available for replication.

## Preparing for authentication

To access your data, you need to authenticate the connection with your account credentials.

Information noteMake sure that the account you use has read access to the tables you want to fetch.

The client ID and client secret must be obtained from your Taboola account manager.

## Creating the connection

For more information, see [Connecting to SaaS applications](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/Landing/connecting-web-applications.htm).

1. Fill in the required connection properties.

2. Provide a name for the connection in Connection name.

3. Select Open connection metadata to define metadata for the connection when it has been created.

4. Click Create.

Connection settings

| Setting | Description |
| --- | --- |
| Data gateway | Select a Data Movement gateway if required by your use case.<br><br>Information note<br><br>This field is not available with the Qlik Talend Cloud Starter subscription, as it does not support Data Movement gateway. If you have another subscription tier and do not want to use Data Movement gateway, select None.<br><br>For information on the benefits of Data Movement gateway and use cases that require it, see [Qlik Data Gateway - Data Movement](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/Gateways/replication-gateway.htm). |
| Start Date | Enter the date, in the format `MM/DD/YYYY`, from which the data must be replicated from your source to your target. |
| Username | Username. |
| Password | Password. |
| Account ID | Account ID. |
| Client ID | Client ID. |
| Client Secret | Client secret. |

## Schema

Information note

Schemas and naming conventions can change from version to version. It is recommended to verify your version before continuing.

Depending on your destination, table and column names may not appear as they are outlined below.

### campaign

The `campaign` table contains info about the campaigns in your Taboola account.

#### Replication

During every replication job, all campaigns in your Taboola account will be extracted, or “fully replicated.” If you look in the Extraction Logs in the Stitch app, you’ll see lines like this:

```
2017-10-25 13:46:52,254Z tap - INFO Synced 100 campaigns.
2017-10-25 13:46:52,255Z tap - INFO Done syncing campaigns.
```

Roughly the same amount of campaigns should be extracted during every job, unless brand new campaigns are added between jobs.

When Stitch loads the extracted records into your destination, however, only new and updated campaigns will be loaded. **This means that only new and updated campaign records will count towards your row count**.

#### Deleted campaigns

If a campaign is deleted at the source, the record for that campaign will remain in the destination.

#### NULL dates

On occasion, Taboola’s API will push `NULL` for `start_date` and `999-12-31` for `end_date`. It will convert `NULL` dates to `999-12-31` for consistency.

| **Replication Method** | Full Table |
| --- | --- |
| **Primary Key** | id |
| **Useful links** | [Taboola API method](https://github.com/taboola/Backstage-API/blob/master/Backstage%20API%20-%20Campaigns.pdf "Opens in new tab: Taboola API method") |

campaign table foreign keys

| Join campaign with | on |
| --- | --- |
| [campaign_performance](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-Taboola-v2.htm#campaign-performance) | ```<br>campaign.id = campaign_performance.campaign_id<br>``` |

campaign table schema

| **advertiser\_id**<br><br><br>STRING |
| --- |
| **approval\_state**<br><br><br>STRING |
| **country\_targeting**<br><br><br>OBJECT<br><br>This is a nested data structure:<br><br><ul><li>type: STRING</li><li>value: ARRAY, which is also a nested data structure.											<ul><li>type: STRING</li></ul></li></ul> |
| **cpc**<br><br><br>NUMBER |
| **daily\_cap**<br><br><br>NUMBER |
| **end\_date**<br><br><br>DATE |
| **id**<br><br><br>INTEGER |
| **is\_active**<br><br><br>BOOLEAN |
| **name**<br><br><br>STRING |
| **platform\_targeting**<br><br><br>OBJECT<br><br>This is a nested data structure:<br><br><ul><li>type: STRING</li><li>value: ARRAY, which is also a nested data structure.											<ul><li>type: STRING</li></ul></li></ul> |
| **publisher\_targeting**<br><br><br>OBJECT<br><br>This is a nested data structure:<br><br><ul><li>type: STRING</li><li>value: ARRAY, which is also a nested data structure.											<ul><li>type: STRING</li></ul></li></ul> |
| **spending\_limit**<br><br><br>NUMBER |
| **spending\_limit\_model**<br><br><br>STRING |
| **spent**<br><br><br>NUMBER |
| **start\_date**<br><br><br>DATE |
| **status**<br><br><br>STRING |
| **tracking\_code**<br><br><br>STRING |

### campaign\_performance

The `campaign_performance` table contains performance data for the campaigns in your Taboola account, broken down by day.

| **Replication Method** | CDC |
| --- | --- |
| **Primary Keys** | campaign\_id<br><br>date |
| **Replication Key** | date |
| **Useful links** | [Taboola documentation](https://github.com/taboola/Backstage-API/blob/master/Backstage%20API%20-%20Reports.pdf) |

campaign\_performance table foreign keys

| Join campaign\_performance with | on |
| --- | --- |
| [campaign](https://help.qlik.com/en-US/cloud-services/Subsystems/Hub/Content/Sense_Hub/DataIntegration/WebApplications/Connecting-Taboola-v2.htm#campaign) | ```<br>campaign_performance.campaign_id = campaign.id<br>``` |

campaign\_performance table schema

| **campaign\_id**<br><br><br>INTEGER |
| --- |
| **clicks**<br><br><br>INTEGER |
| **cpa**<br><br><br>NUMBER |
| **cpa\_actions\_num**<br><br><br>INTEGER |
| **cpa\_conversion\_rate**<br><br><br>NUMBER |
| **cpc**<br><br><br>NUMBER |
| **cpm**<br><br><br>NUMBER |
| **ctr**<br><br><br>NUMBER |
| **currency**<br><br><br>STRING |
| **date**<br><br><br>DATE |
| **impressions**<br><br><br>INTEGER |
| **spent**<br><br><br>NUMBER |