google-bigquerygoogle-ads-api

How to remove duplicate campaign IDs from the BigQuery export after campaign name edits?


I have a BigQuery export set up for my Google account, and colleagues working on this account sometimes do name edits on campaigns, ad groups and so on.

Issue is, those changes get recorded in BigQuery as new rows, under the same asset ID: Export from BigQuery

This messes my reports up, as campaign metrics like Impressions are being duplicated in tools like Power BI: Report with duplicated data

I am not sure what the best approach would be here, so I'd gladly accept your support on this matter.


Solution

  • You can use on a daily basis the Ads API to store into another table the list of your assets (ie. campaign). Then either in your BI tool or a BigQuery View you can left join that table to your reporting table on the asset id (ie. campaign_id) to replace the asset name (ie. campaign name) by the latest one.