Providing a 1-stop-shop, centralized view of all your Google Ads policy reports.
Ads Policy Monitor provides a data pipeline for pulling ad and asset approval data from Google Ads, enabling you to monitor trends and spikes with policy approvals.
To keep ads safe and appropriate for everyone, ads are reviewed to make sure they comply with Google Ads policies, read more here.
For large advertisers and agencies, it can be challenging to monitor the state of your ad copy across all of your Google Ads accounts. This can be amplified when automation is used to create ad copy, as it's easy to introduce mistakes that result in ads being disapproved, for example, the incorrect use of capitalisation.
This solution pulls a daily snapshot of your ad and asset policy approvals, stores them in BigQuery, and provides a Looker Studio dashboard template to monitor this.
When disapprovals happen you can take action by following the deeplink into Google Ads to get more information and take action.
In the dashboard you can instantly monitor the overall status of your accounts:
And how this changes over time. This allows you to identify any changes in the trend, to investigate further.
You can drilldown into the disapprovals to try to get more information about why this has happened:
You're also able to see insights like when an ad group has no approved ads:
And analyze asset disapprovals:
- A daily cron job runs that makes a HTTPS request to trigger the
ads_policy_monitor
Cloud Function. - The Cloud Function uses Google Ads Query Language (GAQL) to run a number of reports in Google Ads via the API.
- The output of these reports is written to a dataset in BigQuery called
ads_policy_monitor
. - We provide a template Looker Studio dashboard to visualise this data. However, there is nothing to stop you using your own dashboard solution. For example, it is possible to connect this data with the Looker Platform for more advanced BI reporting, alerting, data drilldown etc.
- A Google Cloud Project
- Access to the Google Ads API (e.g. developer token, account access), see getting started.
- Access to Looker Studio or a dashboard solution that can connect to
BigQuery.
- If you wish to have access to the Looker Studio template provided by Google, please join this group ads-policy-monitor-template-readers.
- Open the Google Cloud Project in the UI.
- Open the OAuth Consent Screen and create a new internal app.
- Open the
API Credentials Screen
-> Create credentials -> OAuth Client ID -> Web app -> Set
https://developers.google.com/oauthplayground
as an authorised redirect URI. Make a note of theclient_id
and theclient_secret
. - Following
OAuth Playground - Generate tokens instructions
generate a refresh token for the following scopes, using the
client_id
andclient_secret
generated in the previous step:https://www.googleapis.com/auth/adwords
- Open Cloud Shell
- Clone the repo & open the directory with the code:
git clone https://github.com/google-marketing-solutions/ads-policy-monitor.git
- Go to
Terminal
->New Terminal
from the menu. Make sure you're in the intended Cloud project. Otherwise, set the shell to use the correct cloud project:gcloud config set project [PROJECT ID]
- In the file editor open up the
ads-policy-monitor/terraform/example.tfvars
, and update the variables with your configuration (including credentials obtained from Steps 3 and 4). - Run the deployment script in the
Terminal
:sh init.sh
Done! Follow the link generated by the deployment script to get your copy of the dashboard. Note: Access to this link is enabled only to users who are part of ads-policy-monitor-template-readers group as stated in the Requirements section.
Please note, the solution is scheduled to run at midnight each day. We recommend waiting for the next day to see the data populated in the dashboard. Alternatively you can force run the job in Cloud Scheduler. However this can create duplicated data if you run more than once a day.
- Big Query API
bigquery.googleapis.com
- Cloud Build
cloudbuild.googleapis.com
- Cloud Funtions
cloudfunctions.googleapis.com
- Cloud Resource Manager API
cloudresourcemanager.googleapis.com
- Google Ads API
googleads.googleapis.com
- Identity and Access Management (IAM)
iam.googleapis.com
- Secret Manager
secretmanager.googleapis.com
- Cloud Run
run.googleapis.com
- Cloud Scheduler
cloudscheduler.googleapis.com
You can also check this on the deployment file ads-policy-monitor/init.sh.
Please refer to the folder google_ads_queries cloud_functions/ads_policy_monitor/gaql.
Can I deploy it in an existing Cloud Project or do I need to create a new one just for this solution?
You can use an existing Project if you want to. However, please remember that the best practice for clients is to create a new project dedicated to this solution (or any new solution).
You can make the Cloud Scheduler run more often than once a day, however you'd need to also make some customization in the code as the code and templates provided here would show duplicated records.
The reason this solution was designed to run once a day was based on learnings from hundreds of deployments, where the tradeoff between solution costs and Policy Reviews turn-around time was taken into consideration.
If youy still wish to make the refresh rate higher, these are some of the adjustments you'd have to perform:
- Introduce time into the
event_date
parameter of the queries. - Update the cron schedule to run more frequently.
- Update the partitioning on the BigQuery table to hourly.
- Update the latestadpolicy data query to filter on only the latest data.
- Refresh your Looker Studio dashboard data source to mke sure the
event_date
is now a datetime and instead of just date.
The code is formatted using yapf. After making a change, before submitting the code please do the following:
Install the dev requirements:
pip install -r requirements_dev.txt
Then run yapf:
yapf --style google -r -i .
This is not an officially supported Google product.
Copyright 2024 Google LLC. This solution, including any related sample code or data, is made available on an “as is,” “as available,” and “with all faults” basis, solely for illustrative purposes, and without warranty or representation of any kind. This solution is experimental, unsupported and provided solely for your convenience. Your use of it is subject to your agreements with Google, as applicable, and may constitute a beta feature as defined under those agreements. To the extent that you make any data available to Google in connection with your use of the solution, you represent and warrant that you have all necessary and appropriate rights, consents and permissions to permit Google to use and process that data. By using any portion of this solution, you acknowledge, assume and accept all risks, known and unknown, associated with its usage, including with respect to your deployment of any portion of this solution in your systems, or usage in connection with your business, if at all.