Skip to content

Commit

Permalink
Add Designated Market Area (DMA) breakdown for Insights report
Browse files Browse the repository at this point in the history
  • Loading branch information
aiguofer committed Jul 3, 2019
1 parent 95fd2a3 commit 40948c8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions tap_facebook/__init__.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
'ads_insights_age_and_gender',
'ads_insights_country',
'ads_insights_platform_and_device',
'ads_insights_region']
'ads_insights_region',
'ads_insights_dma',
]

REQUIRED_CONFIG_KEYS = ['start_date', 'account_id', 'access_token']
UPDATED_TIME_KEY = 'updated_time'
Expand All @@ -63,7 +65,8 @@
'ads_insights_age_and_gender': START_DATE_KEY,
'ads_insights_country': START_DATE_KEY,
'ads_insights_platform_and_device': START_DATE_KEY,
'ads_insights_region': START_DATE_KEY
'ads_insights_region': START_DATE_KEY,
'ads_insights_dma': START_DATE_KEY,
}

LOGGER = singer.get_logger()
Expand Down Expand Up @@ -405,7 +408,7 @@ class AdsInsights(Stream):
bookmark_key = START_DATE_KEY

invalid_insights_fields = ['impression_device', 'publisher_platform', 'platform_position',
'age', 'gender', 'country', 'placement', 'region']
'age', 'gender', 'country', 'placement', 'region', 'dma']

# pylint: disable=no-member,unsubscriptable-object,attribute-defined-outside-init
def __attrs_post_init__(self):
Expand Down Expand Up @@ -518,7 +521,9 @@ def __iter__(self):
"primary-keys": ['publisher_platform',
'platform_position', 'impression_device']},
'ads_insights_region': {'breakdowns': ['region'],
'primary-keys': ['region']}
'primary-keys': ['region']},
'ads_insights_dma': {"breakdowns": ['dma'],
"primary-keys": ['dma']},
}


Expand Down

0 comments on commit 40948c8

Please sign in to comment.