From b95579d2db2d558dfb14b9bc1f4dd64d4bfde0a7 Mon Sep 17 00:00:00 2001 From: Sebastian Smiley Date: Fri, 28 Jul 2023 14:26:43 -0400 Subject: [PATCH] Add conversion metrics to campaign_performance. Fix bug with tests. --- tap_googleads/schemas/campaign_performance.json | 3 +++ tap_googleads/streams.py | 1 + tap_googleads/tests/test_core.py | 2 +- tap_googleads/tests/test_customer_not_found.py | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tap_googleads/schemas/campaign_performance.json b/tap_googleads/schemas/campaign_performance.json index 797a9fa..7f25942 100644 --- a/tap_googleads/schemas/campaign_performance.json +++ b/tap_googleads/schemas/campaign_performance.json @@ -33,6 +33,9 @@ "metrics": { "type": "object", "properties": { + "conversions": { + "type": "number" + }, "clicks": { "type": "string" }, diff --git a/tap_googleads/streams.py b/tap_googleads/streams.py index d56cea2..322d8fd 100644 --- a/tap_googleads/streams.py +++ b/tap_googleads/streams.py @@ -280,6 +280,7 @@ def gaql(self) -> str: , campaign.advertising_channel_sub_type , segments.device , segments.date + , metrics.conversions , metrics.impressions , metrics.clicks , metrics.ctr diff --git a/tap_googleads/tests/test_core.py b/tap_googleads/tests/test_core.py index cf2051e..3c344f8 100644 --- a/tap_googleads/tests/test_core.py +++ b/tap_googleads/tests/test_core.py @@ -7,7 +7,7 @@ SAMPLE_CONFIG = { - "start_date": datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d"), + "start_date": datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"), "client_id": "12345", "client_secret": "12345", "developer_token": "12345", diff --git a/tap_googleads/tests/test_customer_not_found.py b/tap_googleads/tests/test_customer_not_found.py index 102f416..77e794f 100644 --- a/tap_googleads/tests/test_customer_not_found.py +++ b/tap_googleads/tests/test_customer_not_found.py @@ -11,7 +11,7 @@ import responses SAMPLE_CONFIG = { - "start_date": datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%d"), + "start_date": datetime.datetime.now(datetime.timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"), "client_id": "12345", "client_secret": "12345", "developer_token": "12345",