Skip to content

Commit

Permalink
Source Tiktok Marketing: Videometrics (#13650)
Browse files Browse the repository at this point in the history
* added video metrics in streams.py

* common metrics list updated.

* updated streams.py with extended metrics required.

* updated stream_test

* updated configured_catalog

* video metrics required list updated.

* chore: formatting

* chore: bump version in source definitions

* chore: update seed file

Co-authored-by: Harshith Mullapudi <[email protected]>
  • Loading branch information
Zawar92 and harshithmullapudi authored Jun 27, 2022
1 parent 76e50fd commit 5f4dacc
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@
- name: TikTok Marketing
sourceDefinitionId: 4bfac00d-ce15-44ff-95b9-9e3c3e8fbd35
dockerRepository: airbyte/source-tiktok-marketing
dockerImageTag: 0.1.12
dockerImageTag: 0.1.13
documentationUrl: https://docs.airbyte.io/integrations/sources/tiktok-marketing
icon: tiktok.svg
sourceType: api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9153,7 +9153,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-tiktok-marketing:0.1.12"
- dockerImage: "airbyte/source-tiktok-marketing:0.1.13"
spec:
documentationUrl: "https://docs.airbyte.io/integrations/sources/tiktok-marketing"
changelogUrl: "https://docs.airbyte.io/integrations/sources/tiktok-marketing"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ COPY source_tiktok_marketing ./source_tiktok_marketing
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.12
LABEL io.airbyte.version=0.1.13
LABEL io.airbyte.name=airbyte/source-tiktok-marketing
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@
"sync_mode": "full_refresh",
"destination_sync_mode": "append"
},
{
"stream": {
"name": "advertisers_reports",
"json_schema": {},
"supported_sync_modes": ["full_refresh", "incremental"],
"source_defined_cursor": true,
"default_cursor_field": ["dimensions", "stat_time_day"]
},
"sync_mode": "full_refresh",
"destination_sync_mode": "append"
},
{
"stream": {
"name": "advertisers",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,24 @@
"secondary_goal_result_rate",
"cash_spend",
"voucher_spend",
"video_play_actions",
"video_watched_2s",
"video_watched_6s",
"average_video_play",
"average_video_play_per_user",
"video_views_p25",
"video_views_p50",
"video_views_p75",
"video_views_p100",
"profile_visits",
"likes",
"comments",
"shares",
"follows",
"clicks_on_music_disc",
"real_time_app_install",
"real_time_app_install_cost",
"app_install",
]

T = TypeVar("T")
Expand Down Expand Up @@ -486,7 +504,35 @@ def _get_reporting_dimensions(self):

def _get_metrics(self):
# common metrics for all reporting levels
result = ["spend", "cpc", "cpm", "impressions", "clicks", "ctr", "reach", "cost_per_1000_reached", "frequency"]
result = [
"spend",
"cpc",
"cpm",
"impressions",
"clicks",
"ctr",
"reach",
"cost_per_1000_reached",
"frequency",
"video_play_actions",
"video_watched_2s",
"video_watched_6s",
"average_video_play",
"average_video_play_per_user",
"video_views_p25",
"video_views_p50",
"video_views_p75",
"video_views_p100",
"profile_visits",
"likes",
"comments",
"shares",
"follows",
"clicks_on_music_disc",
"real_time_app_install",
"real_time_app_install_cost",
"app_install",
]

if self.report_level == ReportLevel.ADVERTISER and self.report_granularity == ReportGranularity.DAY:
# https://ads.tiktok.com/marketing_api/docs?id=1707957200780290
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,10 @@ def test_stream_slices_report(advertiser_ids, granularity, slices_expected, pend
@pytest.mark.parametrize(
"stream, metrics_number",
[
(AdsReports, 36),
(AdGroupsReports, 33),
(AdvertisersReports, 11),
(CampaignsReports, 10),
(AdsReports, 54),
(AdGroupsReports, 51),
(AdvertisersReports, 29),
(CampaignsReports, 28),
(AdvertisersAudienceReports, 6),
(AdsAudienceReports, 30),
],
Expand All @@ -140,10 +140,10 @@ def test_basic_reports_get_metrics_day(stream, metrics_number):
@pytest.mark.parametrize(
"stream, metrics_number",
[
(AdsReports, 36),
(AdGroupsReports, 33),
(AdvertisersReports, 9),
(CampaignsReports, 10),
(AdsReports, 54),
(AdGroupsReports, 51),
(AdvertisersReports, 27),
(CampaignsReports, 28),
(AdvertisersAudienceReports, 6),
],
)
Expand Down
1 change: 1 addition & 0 deletions docs/integrations/sources/tiktok-marketing.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ The connector is restricted by [requests limitation](https://ads.tiktok.com/mark

| Version | Date | Pull Request | Subject |
|:--------|:-----------|:---------------------------------------------------------|:----------------------------------------------------------------------------------------------|
| 0.1.13 | 2022-06-28 | [13650](https://github.com/airbytehq/airbyte/pull/13650) | Added new stream Videometrics | |
| 0.1.12 | 2022-05-24 | [13127](https://github.com/airbytehq/airbyte/pull/13127) | Fixed integration test |
| 0.1.11 | 2022-04-27 | [12838](https://github.com/airbytehq/airbyte/pull/12838) | Added end date configuration for tiktok |
| 0.1.10 | 2022-05-07 | [12545](https://github.com/airbytehq/airbyte/pull/12545) | Removed odd production authenication method |
Expand Down

0 comments on commit 5f4dacc

Please sign in to comment.