Unique identifier for Campaign Performance Report?

Tom MacDonald 1 Reputation point
2022-11-30T19:52:25.053+00:00

I'm trying to find a unique identifier for the Bing Ads Campaign Performance Report to help remove duplicates. I'm currently pulling all of these columns from the API:

https://learn.microsoft.com/en-us/advertising/reporting-service/campaignperformancereportcolumn?view=bingads-13#values

I'm performing a daily aggregation.

Microsoft Advertising API
Microsoft Advertising API
A Microsoft API that provides programmatic access to Microsoft Advertising to manage large campaigns or to integrate your marketing with other in-house systems.
388 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Tom MacDonald 1 Reputation point
    2022-12-01T16:14:11.677+00:00

    So far this seems to provide an adequate unique identifier:

    		md5_hex(  
    			concat_ws(  
    				'||'  
    				, trim(lower(coalesce(accountname::varchar, '^^')))  
    				, trim(lower(coalesce(accountstatus::varchar, '^^')))  
    				, trim(lower(coalesce(addistribution::varchar, '^^')))  
    				, trim(lower(coalesce(bidmatchtype::varchar, '^^')))  
    				, trim(lower(coalesce(campaignname::varchar, '^^')))  
    				, trim(lower(coalesce(deliveredmatchtype::varchar, '^^')))  
    				, trim(lower(coalesce(deviceos::varchar, '^^')))  
    				, trim(lower(coalesce(devicetype::varchar, '^^')))  
    				, trim(lower(coalesce(goal::varchar, '^^')))  
    				, trim(lower(coalesce(network::varchar, '^^')))  
    				, trim(lower(coalesce(timeperiod::date::varchar, '^^')))  
    				, trim(lower(coalesce(topvsother::varchar, '^^')))  
    			)  
    		) as id  
    
    0 comments No comments