Freedan is a framework to quickly create cross-account automation with Google AdWords. Using it, one can easily automate big parts of manual day-to-day work, quickly test new ideas to improve performance or even build sophisticated software solutions such as a custom bidding algorithm.
Freedan provides an alternative to UI Scripts, Power Editor by building on top of the native Python client library for Google AdWords.
Especially when accounts become large, the former solutions tend to get slow and painful to use. Compared to UI Scripts, you have the freedom to test and integrate the code to your existing code base. Also, you won't encounter any of the limitations such as limited runtime, limited scheduling options, operation limits etc. since you can host it on your own.
Freedan provides a simpler user interface for the most frequently used parts of the AdWords API, while incorporating all best practises suggested by Google.
Common goals for Freedan scripts:
- Validate/adapt namings of accounts, campaigns, adgroups, ... > improve data quality
- Delete old/empty campaigns, adgroups, ... > improve speed when working with Power Editor
- Adjust bids > improve cost efficiency of accounts
- Update ads > improve customer experience + raise CTR
- Create negative keywords > reallocate search queries to more suitable keywords and/or block bad traffic
- Create new accounts / add more keywords > increase reach to target more customers
Expected workflow of those scripts:
- Gather custom input (CLI, data warehouses, Google Drive, ...)
- Gather account information from AdWords
- Compute changes
- Upload updated parameters back to AdWords
-
For an introduction to AdWords refer to AdWords_Introduction.md.
-
Install python 3.6.
- Check out pyenv and pyenv-virtualenv if you have an older version of python installed
-
You can install Freedan using pip.
$ pip install freedan
-
Get access to AdWords API and cache all credential information in a .yaml file.
- Google's tutorial for authenticating with their API
- Google's client library for python
- You'll need to pass the path to this file to the AdWordsService object for authentication.
from freedan import AdWordsService credentials_path = "adwords_credentials.yaml" adwords_service = AdWordsService(credentials_path)
-
Try to run the code in examples/basic/account_hierarchy.py to see if everything is working.
- Everything is built with Python. I'm using python 3.6. and didn't check for compatibility with other Python versions
- According Raymond Hettinger's great talk about dictionaries in python 3.6. you should consider updating anyway ;)
- All scripts heavily rely on pandas: The flexible, easy and powerful data analysis library for python
- Tests are intended to work with pytest: A very easy, yet powerful framework for testing
Please have a look at the example folder. Those scripts demonstrate the power and beauty of the framework. Some of the advanced scripts might be ready for production as they are - so they might safe you a lot of time. Let me know if you find them useful!
The project was launched and is currently maintained by me, Martin Winkel: martin.winkel.pps@gmail.com.
I recently relocated to Vancouver, BC, Canada.
If you've found a bug, please let me know. File an issue or send me an email.
Contributors are very welcome! There's still a lot of good stuff to build :)
If you find any important functionality missing, please let me know or create a pull request.
The next big step will be the addition of placeholder methods to Account, Campaign, AdGroup and ETA. You'll then be able to plug and play your unique business logic encoded in the names of those objects.