Automate the movement of products/listing groups between campaigns based on performance goals using the Google Ads API. This tool is designed to save time and reduce errors in managing large-scale ad campaigns.
Sony needed a solution to move products/listing groups between campaigns based on performance goals (return on ad spend). Doing this manually across thousands of products is tedious, time consuming and error prone. Using the Google Ads API I was able to automate this, and save many hours spent on this mundane task.
- Python 3.8+
- Access to Google Ads account
- Gmail account for sending notifications (optional)
Use the email_sender file to send an email on what the program does! This is configured for a gmail address, using the gmail SMTP server.
Customize the query to pull in different metrics, in order to include/exclude or move listings between PMax campaigns.
In order to include or exclude a product, the listing group filter must be removed and created again. Ensure that it's being created with the correct parameters.
The include file relies on asset group strings to be the same. Ideally we wouldn't have to rely on this because the could potentially be adjusted in the Google Ads platform. In the future we will pull asset group IDs dynamically and match them across both campaigns.
- Obtain a developer token
- Choose a client library
- Set up OAuth2
- Get a refresh token
- Update CID in the lambda_fetch_listing_group file
- Add email address/password for sending emails using the gmail SMTP server
- Try it out! Make sure to use a test campaign at first. All changes will be noted in the change history
Ensure that your credentials are stored securely. Avoid hardcoding sensitive information directly into your scripts. Use environment variables or secure credential storage services.
Feel free to fork this project and submit pull requests. For major changes, please open an issue first to discuss what you would like to change.
If you have any questions or encounter issues, please open an issue or contact [email protected]