> 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/emplifi/integration-specifications.md).

# Integration Specifications

## API Endpoints

The Daasity Emplifi extractor is built based on this [Emplifi (Social Bakers) API Documentation](https://api.socialbakers.com/#dataapi). The following endpoints are used by Daasity to replicate data from Emplifi:

* [Profile Metrics](https://api.emplifi.io/#profile-metrics)
* [Posts](https://api.emplifi.io/#posts)
* [Aggregated Post Metrics](https://api.emplifi.io/#aggregated-post-metrics-crossplatform)

## Entity Relationship Diagram (ERD)

[This link diagram houses the ERD ](https://lucid.app/lucidchart/12de6b6a-f126-45dc-81ef-9356eadd0a3b/edit?page=0_0)for the Daasity Emplifi integration illustrating the different out-of-box tables and keys used to join across tables. Hover over the embedded diagram to reveal controls to zoom and scroll.

## Emplifi Schema

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

* Custom Reports (Metrics)
* Profiles
* Posts
* Aggregated Metrics

**Note:** The default tables in the Emplifi schema use the Posts API. The Profile Metrics and Aggregated Post Metrics API generate custom tables within the Daasity platform

## Custom Reports (Metrics Endpoint)

This endpoint is a custom endpoint that must be configured within the Daasity App - review this [article](http://support.daasity.com/knowledge/how-to-setup-emplifi) on how to setup custom reports

The integration runs on a daily basis with a primary and secondary extract:

1. Primary Extract: the integration extracts all the Profiles that are available within each platform
2. Secondary Extract: the integration extracts the dimensions and metrics as specified in the integration setup for each profile within each platform

The Emplifi integration has certain limitations as outlined [here](https://api.socialbakers.com/#limits):

* Can only extract 12 months of history at one time
* Limited to 25 metrics per report

**CAUTION:** The Daasity integration with Emplifi only extracts data from the six (6) supported platforms in the Profile Metrics section of the Data API

All custom tables generated by the Emplifi integration will be created in the \[emplifi] schema within the database.

* Update Method: UPSERT

The table name and definition is based on the selections made when setting up each report within the Daasity app. Every report will have at a minimum the following fields:

| **Emplifi Field** | **Database Column** |
| ----------------- | ------------------- |
| date.day          | date\_day           |
| profile           | profile             |

Additional metrics and dimensions can be selected based on the platform selected:

* [Facebook](https://api.socialbakers.com/#facebook-metrics)
* [Instagram](https://api.socialbakers.com/#instagram-metrics)
* [Twitter](https://api.socialbakers.com/#twitter-metrics)
* [YouTube](https://api.socialbakers.com/#youtube-metrics)
* [LinkedIn](https://api.socialbakers.com/#linkedin-metrics)
* [Pinterest](https://api.socialbakers.com/#pinterest-metrics)

**NOTE:** When selecting additional metrics and dimensions, you can only select one dimension noted with a \* and you can only select metrics with dimensions that are listed in the Social Bakers documentation above

## Profiles Table

The \[profiles] table is generated by requesting a list of all the profiles connected in Emplifi for each platform (Facebook, Instagram, Twitter, YouTube, LinkedIn, Pinterest, TikTok and Snapchat) by using the [List of Connected Profiles endpoint](https://api.socialbakers.com/#list-of-connected-profiles)

This is the first extract run on a daily basis to determine if any new profiles have been added to Emplifi

* Update method: UPSERT
* Table Name: emplifi.profiles

| **Emplifi Field**                                                | **Database Column** |
| ---------------------------------------------------------------- | ------------------- |
| id                                                               | profile\_id         |
| N/A - determined based on the {network} passed into the API call | social\_platform    |
| name                                                             | name                |
| timezone                                                         | timezone            |
| insights\_enabled                                                | insights\_enabled   |
| profile\_name                                                    | profile\_name       |

## Posts Table

Posts, Post Labels and Post Attachments tables are generated for each platform selected under **Posts** when setting up the integration in the Daasity app: Facebook, Instagram, YouTube, LinkedIn, TikTok and Pinterest. Each platform has its own tables, named after the platform (for example `emplifi.facebook_posts`). They are generated by using the [Posts](https://api.emplifi.io/#posts) endpoint for that platform:

* [Facebook](https://api.socialbakers.com/#facebook-page-post-metrics)
* [Instagram](https://api.socialbakers.com/#instagram-profile-post-metrics)
* [Youtube](https://api.socialbakers.com/#youtube-profile-video-metrics)
* [LinkedIn](https://api.socialbakers.com/#linkedin-profile-post-metrics)
* TikTok
* Pinterest

| Platform  | Tables                                                                                                                                                           |
| --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Facebook  | facebook\_posts, facebook\_post\_labels, facebook\_posts\_attachments, insights\_video\_view\_time\_by\_countries, insights\_video\_view\_time\_by\_gender\_ages |
| Instagram | instagram\_posts, instagram\_post\_labels, instagram\_posts\_attachments                                                                                         |
| YouTube   | youtube\_posts, youtube\_post\_labels                                                                                                                            |
| LinkedIn  | linkedin\_posts, linkedin\_post\_labels, linkedin\_posts\_attachments                                                                                            |
| TikTok    | tiktok\_posts, tiktok\_post\_labels, tiktok\_posts\_attachments, tiktok\_insights\_impressions\_by\_traffic\_source, tiktok\_insights\_viewers\_by\_country      |
| Pinterest | pinterest\_posts, pinterest\_post\_labels, pinterest\_posts\_attachments                                                                                         |

{% hint style="info" %}
The `insights_*` columns are only filled for profiles that have insights enabled in Emplifi (`insights_enabled` in the profiles table).
{% endhint %}

## **Posts**

* Update method: UPSERT on `__sync_key` = MD5(post id + extraction date), so each post gets one row per day it is extracted
* Table Name: `emplifi.<platform>_posts`

**NOTE:** Post Metrics are captured daily and kept as one row per post per day so trends on how a post has performed over time can be measured. Thus to capture the current performance of a post you must select the most recent row from the table.

To see performance over time make sure to include the \_date column in your reporting which identifies when the data was captured

### Facebook Posts

* Table Name: emplifi.facebook\_posts

| **Emplifi Field**                                                | **Database Column**                                              |
| ---------------------------------------------------------------- | ---------------------------------------------------------------- |
| author::id                                                       | author\_id                                                       |
| author::name                                                     | author\_name                                                     |
| author::url                                                      | author\_url                                                      |
| comments                                                         | comments                                                         |
| comments\_sentiment::positive                                    | comments\_sentiment\_positive                                    |
| comments\_sentiment::neutral                                     | comments\_sentiment\_neutral                                     |
| comments\_sentiment::negative                                    | comments\_sentiment\_negative                                    |
| content                                                          | content                                                          |
| content\_type                                                    | content\_type                                                    |
| created\_time                                                    | created\_time                                                    |
| deleted                                                          | deleted                                                          |
| grade                                                            | grade                                                            |
| hidden                                                           | hidden                                                           |
| id                                                               | id                                                               |
| interactions                                                     | interactions                                                     |
| interactions\_per\_1k\_fans                                      | interactions\_per\_1k\_fans                                      |
| media\_type                                                      | media\_type                                                      |
| origin                                                           | origin                                                           |
| page::name                                                       | page\_name                                                       |
| page::url                                                        | page\_url                                                        |
| post\_attribution::status                                        | post\_attribution\_status                                        |
| post\_attribution::type                                          | post\_attribution\_type                                          |
| profileId                                                        | profile\_id                                                      |
| published                                                        | published                                                        |
| reactions                                                        | reactions                                                        |
| reactions\_by\_type::like                                        | reactions\_by\_type\_like                                        |
| reactions\_by\_type::love                                        | reactions\_by\_type\_love                                        |
| reactions\_by\_type::wow                                         | reactions\_by\_type\_wow                                         |
| reactions\_by\_type::haha                                        | reactions\_by\_type\_haha                                        |
| reactions\_by\_type::sorry                                       | reactions\_by\_type\_sorry                                       |
| reactions\_by\_type::anger                                       | reactions\_by\_type\_anger                                       |
| sentiment                                                        | sentiment                                                        |
| shares                                                           | shares                                                           |
| spam                                                             | spam                                                             |
| universal\_video\_id                                             | universal\_video\_id                                             |
| url                                                              | url                                                              |
| video::id                                                        | video\_id                                                        |
| video::length                                                    | video\_length                                                    |
| video::crosspost                                                 | video\_crosspost                                                 |
| video::crosspostable                                             | video\_crosspostable                                             |
| video::live                                                      | video\_live                                                      |
| video::shared                                                    | video\_shared                                                    |
| insights\_engaged\_users                                         | insights\_engaged\_users                                         |
| insights\_engagements                                            | insights\_engagements                                            |
| insights\_impressions                                            | insights\_impressions                                            |
| insights\_impressions\_by\_post\_attribution::paid               | insights\_impressions\_by\_post\_attribution\_paid               |
| insights\_impressions\_by\_post\_attribution::organic            | insights\_impressions\_by\_post\_attribution\_organic            |
| insights\_impressions\_by\_post\_attribution::viral              | insights\_impressions\_by\_post\_attribution\_viral              |
| insights\_impressions\_engagement\_rate                          | insights\_impressions\_engagement\_rate                          |
| insights\_interactions                                           | insights\_interactions                                           |
| insights\_interactions\_by\_interaction\_type::comments          | insights\_interactions\_by\_interaction\_type\_comments          |
| insights\_interactions\_by\_interaction\_type::reactions         | insights\_interactions\_by\_interaction\_type\_reactions         |
| insights\_interactions\_by\_interaction\_type::shares            | insights\_interactions\_by\_interaction\_type\_shares            |
| insights\_negative\_feedback\_unique                             | insights\_negative\_feedback\_unique                             |
| insights\_post\_clicks                                           | insights\_post\_clicks                                           |
| insights\_post\_clicks\_by\_clicks\_type::link\_clicks           | insights\_post\_clicks\_by\_clicks\_type\_link\_clicks           |
| insights\_post\_clicks\_by\_clicks\_type::button\_clicks         | insights\_post\_clicks\_by\_clicks\_type\_button\_clicks         |
| insights\_post\_clicks\_by\_clicks\_type::other\_clicks          | insights\_post\_clicks\_by\_clicks\_type\_other\_clicks          |
| insights\_post\_clicks\_by\_clicks\_type::photo\_views           | insights\_post\_clicks\_by\_clicks\_type\_photo\_views           |
| insights\_post\_clicks\_by\_clicks\_type::video\_plays           | insights\_post\_clicks\_by\_clicks\_type\_video\_plays           |
| insights\_post\_clicks\_unique                                   | insights\_post\_clicks\_unique                                   |
| insights\_reach                                                  | insights\_reach                                                  |
| insights\_reach\_by\_post\_attribution::paid                     | insights\_reach\_by\_post\_attribution\_paid                     |
| insights\_reach\_by\_post\_attribution::organic                  | insights\_reach\_by\_post\_attribution\_organic                  |
| insights\_reach\_by\_post\_attribution::viral                    | insights\_reach\_by\_post\_attribution\_viral                    |
| insights\_reach\_engagement\_rate                                | insights\_reach\_engagement\_rate                                |
| insights\_reactions                                              | insights\_reactions                                              |
| insights\_reactions\_by\_type::anger                             | insights\_reactions\_by\_type\_anger                             |
| insights\_reactions\_by\_type::haha                              | insights\_reactions\_by\_type\_haha                              |
| insights\_reactions\_by\_type::like                              | insights\_reactions\_by\_type\_like                              |
| insights\_reactions\_by\_type::love                              | insights\_reactions\_by\_type\_love                              |
| insights\_reactions\_by\_type::sorry                             | insights\_reactions\_by\_type\_sorry                             |
| insights\_reactions\_by\_type::wow                               | insights\_reactions\_by\_type\_wow                               |
| insights\_video\_view\_time                                      | insights\_video\_view\_time                                      |
| insights\_video\_view\_time\_average                             | insights\_video\_view\_time\_average                             |
| insights\_video\_view\_time\_by\_distribution::owned             | insights\_video\_view\_time\_by\_distribution\_owned             |
| insights\_video\_view\_time\_by\_distribution::shared            | insights\_video\_view\_time\_by\_distribution\_shared            |
| insights\_video\_view\_time\_by\_post\_attribution::organic      | insights\_video\_view\_time\_by\_post\_attribution\_organic      |
| insights\_video\_view\_time\_by\_post\_attribution::paid         | insights\_video\_view\_time\_by\_post\_attribution\_paid         |
| insights\_video\_views                                           | insights\_video\_views                                           |
| insights\_video\_views\_10s                                      | insights\_video\_views\_10s                                      |
| insights\_video\_views\_10s\_by\_play\_type::autoplayed          | insights\_video\_views\_10s\_by\_play\_type\_autoplayed          |
| insights\_video\_views\_10s\_by\_play\_type::click\_to\_play     | insights\_video\_views\_10s\_by\_play\_type\_click\_to\_play     |
| insights\_video\_views\_10s\_by\_post\_attribution::organic      | insights\_video\_views\_10s\_by\_post\_attribution\_organic      |
| insights\_video\_views\_10s\_by\_post\_attribution::paid         | insights\_video\_views\_10s\_by\_post\_attribution\_paid         |
| insights\_video\_views\_10s\_by\_sound::on                       | insights\_video\_views\_10s\_by\_sound\_on                       |
| insights\_video\_views\_10s\_by\_sound::off                      | insights\_video\_views\_10s\_by\_sound\_off                      |
| insights\_video\_views\_10s\_unique                              | insights\_video\_views\_10s\_unique                              |
| insights\_video\_views\_30s                                      | insights\_video\_views\_30s                                      |
| insights\_video\_views\_30s\_by\_play\_type::autoplayed          | insights\_video\_views\_30s\_by\_play\_type\_autoplayed          |
| insights\_video\_views\_30s\_by\_play\_type::click\_to\_play     | insights\_video\_views\_30s\_by\_play\_type\_click\_to\_play     |
| insights\_video\_views\_30s\_by\_post\_attribution::organic      | insights\_video\_views\_30s\_by\_post\_attribution\_organic      |
| insights\_video\_views\_30s\_by\_post\_attribution::paid         | insights\_video\_views\_30s\_by\_post\_attribution\_paid         |
| insights\_video\_views\_30s\_unique                              | insights\_video\_views\_30s\_unique                              |
| insights\_video\_views\_average\_completion                      | insights\_video\_views\_average\_completion                      |
| insights\_video\_views\_by\_play\_type::autoplayed               | insights\_video\_views\_by\_play\_type\_autoplayed               |
| insights\_video\_views\_by\_play\_type::click\_to\_play          | insights\_video\_views\_by\_play\_type\_click\_to\_play          |
| insights\_video\_views\_by\_post\_attribution::organic           | insights\_video\_views\_by\_post\_attribution\_organic           |
| insights\_video\_views\_by\_post\_attribution::paid              | insights\_video\_views\_by\_post\_attribution\_paid              |
| insights\_video\_views\_by\_sound::on                            | insights\_video\_views\_by\_sound\_on                            |
| insights\_video\_views\_by\_sound::off                           | insights\_video\_views\_by\_sound\_off                           |
| insights\_video\_views\_complete                                 | insights\_video\_views\_complete                                 |
| insights\_video\_views\_complete\_by\_post\_attribution::organic | insights\_video\_views\_complete\_by\_post\_attribution\_organic |
| insights\_video\_views\_complete\_by\_post\_attribution::paid    | insights\_video\_views\_complete\_by\_post\_attribution\_paid    |
| insights\_video\_views\_complete\_unique                         | insights\_video\_views\_complete\_unique                         |
| insights\_video\_views\_complete\_unique\_by\_post\_attribution  | insights\_video\_views\_complete\_unique\_by\_post\_attribution  |
| insights\_video\_views\_distribution::owned                      | insights\_video\_views\_distribution\_owned                      |
| insights\_video\_views\_distribution::shared                     | insights\_video\_views\_distribution\_shared                     |
| insights\_video\_views\_unique                                   | insights\_video\_views\_unique                                   |
| insights\_video\_views\_unique\_by\_post\_attribution::organic   | insights\_video\_views\_unique\_by\_post\_attribution\_organic   |
| insights\_video\_views\_unique\_by\_post\_attribution::paid      | insights\_video\_views\_unique\_by\_post\_attribution\_paid      |

### Instagram Posts

* Table Name: emplifi.instagram\_posts

| **Emplifi Field**                 | **Database Column**                                  |
| --------------------------------- | ---------------------------------------------------- |
| author::id                        | author\_id                                           |
| author::name                      | author\_name                                         |
| author::url                       | author\_url                                          |
| comments                          | comments                                             |
| comments\_sentiment::positive     | comments\_sentiment\_positive                        |
| comments\_sentiment::neutral      | comments\_sentiment\_neutral                         |
| comments\_sentiment::negative     | comments\_sentiment\_negative                        |
| content                           | content                                              |
| content\_type                     | content\_type                                        |
| created\_time                     | created\_time                                        |
| grade                             | grade                                                |
| id                                | id                                                   |
| interactions                      | interactions                                         |
| interactions\_per\_1k\_fans       | interactions\_per\_1k\_fans                          |
| likes                             | likes                                                |
| media\_type                       | media\_type                                          |
| page::name                        | page\_name                                           |
| page::url                         | page\_url                                            |
| post\_attribution::status         | post\_attribution\_status                            |
| post\_attribution::type           | post\_attribution\_type                              |
| profileId                         | profile\_id                                          |
| sentiment                         | sentiment                                            |
| url                               | url                                                  |
| insights\_engagement              | insights\_engagement                                 |
| insights\_impressions             | insights\_impressions                                |
| insights\_reach                   | insights\_reach                                      |
| insights\_saves                   | insights\_saves                                      |
| insights\_story\_completion\_rate | insights\_story\_completion\_rate                    |
| insights\_story\_exits            | insights\_story\_exits                               |
| insights\_story\_replies          | insights\_story\_replies                             |
| insights\_story\_taps\_back       | insights\_story\_taps\_back                          |
| insights\_story\_taps\_forward    | insights\_story\_taps\_forward                       |
| insights\_video\_views            | insights\_video\_views                               |
| — (not populated)                 | insights\_engagement\_by\_engagement\_type\_comments |
| — (not populated)                 | insights\_engagement\_by\_engagement\_type\_likes    |
| — (not populated)                 | insights\_engagement\_by\_engagement\_type\_saves    |

### YouTube Posts

* Table Name: emplifi.youtube\_posts

| **Emplifi Field**           | **Database Column**         |
| --------------------------- | --------------------------- |
| author::id                  | author\_id                  |
| author::name                | author\_name                |
| author::url                 | author\_url                 |
| channel::id                 | channel\_id                 |
| channel::name               | channel\_name               |
| channel::url                | channel\_url                |
| comments                    | comments                    |
| created\_time               | created\_time               |
| description                 | description                 |
| dislikes                    | dislikes                    |
| duration                    | duration                    |
| id                          | id                          |
| insights\_engagement        | insights\_engagement        |
| interactions                | interactions                |
| interactions\_per\_1k\_fans | interactions\_per\_1k\_fans |
| likes                       | likes                       |
| media\_type                 | media\_type                 |
| profileId                   | profile\_id                 |
| url                         | url                         |
| video\_view\_time           | video\_view\_time           |
| video\_views                | video\_views                |

### LinkedIn Posts

* Table Name: emplifi.linkedin\_posts

| **Emplifi Field**           | **Database Column**         |
| --------------------------- | --------------------------- |
| author::id                  | author\_id                  |
| author::name                | author\_name                |
| author::url                 | author\_url                 |
| comments                    | comments                    |
| content                     | content                     |
| content\_type               | content\_type               |
| created\_time               | created\_time               |
| id                          | id                          |
| interactions                | interactions                |
| interactions\_per\_1k\_fans | interactions\_per\_1k\_fans |
| media\_type                 | media\_type                 |
| page::name                  | page\_name                  |
| page::url                   | page\_url                   |
| profileId                   | profile\_id                 |
| reactions                   | reactions                   |
| url                         | url                         |

### TikTok Posts

* Table Name: emplifi.tiktok\_posts

| **Emplifi Field**                 | **Database Column**               |
| --------------------------------- | --------------------------------- |
| author::id                        | author\_id                        |
| author::name                      | author\_name                      |
| author::url                       | author\_url                       |
| content\_type                     | content\_type                     |
| created\_time                     | created\_time                     |
| duration                          | duration                          |
| id                                | id                                |
| link                              | link                              |
| media                             | media                             |
| message                           | message                           |
| insights\_avg\_time\_watched      | insights\_avg\_time\_watched      |
| insights\_comments                | insights\_comments                |
| insights\_completion\_rate        | insights\_completion\_rate        |
| insights\_engagements             | insights\_engagements             |
| insights\_impressions             | insights\_impressions             |
| insights\_likes                   | insights\_likes                   |
| insights\_reach                   | insights\_reach                   |
| insights\_reach\_engagement\_rate | insights\_reach\_engagement\_rate |
| insights\_shares                  | insights\_shares                  |
| insights\_video\_views            | insights\_video\_views            |
| insights\_view\_time              | insights\_view\_time              |

### Pinterest Posts

* Table Name: emplifi.pinterest\_posts

| **Emplifi Field**                       | **Database Column**                     |
| --------------------------------------- | --------------------------------------- |
| author::id                              | author\_id                              |
| author::name                            | author\_name                            |
| author::url                             | author\_url                             |
| content                                 | content                                 |
| content\_type                           | content\_type                           |
| created\_time                           | created\_time                           |
| id                                      | id                                      |
| media\_type                             | media\_type                             |
| profileId                               | profile\_id                             |
| profile::name                           | profile\_name                           |
| profile::url                            | profile\_url                            |
| url                                     | url                                     |
| comments                                | comments                                |
| insights\_avg\_time\_watched            | insights\_avg\_time\_watched            |
| insights\_engagements                   | insights\_engagements                   |
| insights\_impressions                   | insights\_impressions                   |
| insights\_impressions\_engagement\_rate | insights\_impressions\_engagement\_rate |
| insights\_link\_clicks                  | insights\_link\_clicks                  |
| insights\_post\_clicks                  | insights\_post\_clicks                  |
| insights\_post\_saves                   | insights\_post\_saves                   |
| insights\_reactions                     | insights\_reactions                     |
| insights\_save\_rate                    | insights\_save\_rate                    |
| insights\_video\_completed\_views       | insights\_video\_completed\_views       |
| insights\_video\_starts                 | insights\_video\_starts                 |
| insights\_video\_views                  | insights\_video\_views                  |
| insights\_video\_views\_10s             | insights\_video\_views\_10s             |
| insights\_view\_time                    | insights\_view\_time                    |
| interactions                            | interactions                            |
| interactions\_per\_1k\_fans             | interactions\_per\_1k\_fans             |

## **Post Labels**

* Update method: UPSERT
* Table Name: `emplifi.<platform>_post_labels` (all six platforms)

| **Emplifi Field**  | **Database Column** |
| ------------------ | ------------------- |
| post\_labels::id   | id                  |
| id (of the post)   | post\_id            |
| post\_labels::name | name                |

## **Post Attachments**

* Update method: UPSERT
* Table Name: `emplifi.<platform>_posts_attachments` (all platforms except YouTube)

Facebook and LinkedIn:

| **Emplifi Field**        | **Database Column** |
| ------------------------ | ------------------- |
| id (of the post)         | post\_id            |
| attachments::title       | title               |
| attachments::description | description         |
| attachments::url         | url                 |
| attachments::image\_url  | image\_url          |
| attachments::type        | type                |

Instagram, TikTok and Pinterest:

| **Emplifi Field**       | **Database Column** |
| ----------------------- | ------------------- |
| id (of the post)        | post\_id            |
| attachments::image\_url | image\_url          |
| attachments::type       | type                |

## **Facebook Video View Time**

* Update method: UPSERT
* Table Names: emplifi.insights\_video\_view\_time\_by\_countries and emplifi.insights\_video\_view\_time\_by\_gender\_ages

| **Emplifi Field**                                    | **Database Column** |
| ---------------------------------------------------- | ------------------- |
| id (of the post)                                     | post\_id            |
| insights\_video\_view\_time\_by\_country (key)       | country             |
| insights\_video\_view\_time\_by\_country (value)     | view\_time          |
| insights\_video\_view\_time\_by\_gender\_age (key)   | age\_range          |
| insights\_video\_view\_time\_by\_gender\_age (value) | view\_time          |

`country` is only in insights\_video\_view\_time\_by\_countries and `age_range` is only in insights\_video\_view\_time\_by\_gender\_ages.

## **TikTok Insights Breakdowns**

* Update method: UPSERT
* Table Names: emplifi.tiktok\_insights\_impressions\_by\_traffic\_source and emplifi.tiktok\_insights\_viewers\_by\_country

| **Emplifi Field**                                              | **Database Column** |
| -------------------------------------------------------------- | ------------------- |
| id (of the post)                                               | post\_id            |
| insights\_impressions\_by\_traffic\_source::impression\_source | impression\_source  |
| insights\_impressions\_by\_traffic\_source::percentage         | percentage          |
| insights\_viewers\_by\_country::country                        | country             |
| insights\_viewers\_by\_country::percentage                     | percentage          |

`impression_source` is only in tiktok\_insights\_impressions\_by\_traffic\_source and `country` is only in tiktok\_insights\_viewers\_by\_country.

## Aggregated Metrics

The tables are generated by extracting data from the [Aggregated Post Metrics API](https://api.socialbakers.com/#aggregated-post-metrics-crossplatform). Each metric is stored in its own table, at one of two levels of detail: the profile / post label level or the profile level.

## **Profile Post Labels**

Profile / post label metrics are selected per platform when setting up the integration in the Daasity app. The supported metrics are insights\_engagements, insights\_impressions, insights\_impressions\_engagement\_rate, insights\_media\_views, insights\_video\_views and page\_posts (not every metric is available on every platform). The last few days are re-extracted on each daily run.

* Update method: UPSERT on `__sync_key` = MD5(platform + date + profile id + post label)
* Table Name: `emplifi.<metric>_profile_post_label` (for example `emplifi.insights_impressions_profile_post_label`)

| **Emplifi Field**        | **Database Column** |
| ------------------------ | ------------------- |
| Date of the result       | \_date              |
| profile::id              | profile\_id         |
| profile::platform        | social\_platform    |
| post\_labels (dimension) | post\_label         |
| Metric value             | value               |

## **Profile**

Profile level metrics (no post label breakdown) are set up through a support request to the Daasity team - please contact <support@daasity.com> to set up your aggregated metrics.

* Update method: UPSERT on `__sync_key` = MD5(platform + date + profile id)
* Table Name: `emplifi.<metric>_profile`

| **Emplifi Field** | **Database Column** |
| ----------------- | ------------------- |
| date.day          | \_date              |
| profile::id       | profile\_id         |
| profile::platform | social\_platform    |
| Metric value      | value               |
