Hi there,
I am able to use python SDK, to pull campaign Async analytics. However response are tagged to an Id pulled from active entities which i believe is campaign_id.
-
How do we get associated campaign name using same SDK.
-
I want to segment the result using segment type of POSTAL_CODE and Country… Is there mapping of country code like for US what is code and also same for postal_code.
here is my asyn call:
create async stats jobs and get job ids
queued_job_ids =
for chunk_ids in split_list(ids, 20):
queued_job_ids.append(LineItem.queue_async_stats_job(account, chunk_ids, metric_groups, granularity=granularity, placement=placement, start_time=start_time, end_time=end_time).id)
let the job complete
seconds = 30
time.sleep(seconds)
async_stats_job_results = LineItem.async_stats_job_result(account, job_ids=queued_job_ids)
async_data =
for result in async_stats_job_results:
async_data.append(LineItem.async_stats_job_data(account, url=result.url))
print(async_data
I tried as below, but it returns result as:
“segment”:{
“segment_name”:“Unknown”,
“segment_value”:“0000000000000000”
},
country = '96683cc9126741d1'
segmentation_type = 'POSTAL_CODES'
for chunk_ids in split_list(ids, 20):
queued_job_ids.append(LineItem.queue_async_stats_job(account, chunk_ids, metric_groups, granularity=granularity, placement=placement, start_time=start_time, end_time=end_time, country=country, segmentation_type=segmentation_type).id)
However when i tried using segmentation_type=‘METROS’ for country=‘96683cc9126741d1’, i did got segmented result as:
“segment”:{
“segment_name”:“Parkersburg WV, US”,
“segment_value”:“af5f7cc4ddeb4399”
},
so my question is, what are mapping between country and postal_code? seems like there is custom code for each country, where can i find that mapping? like if we want for UK
Thanks,