This page provides you with instructions on how to extract data from AdWords and load it into Azure SQL Data Warehouse. (If this manual process sounds onerous, check out Stitch, which can do all the heavy lifting for you in just a few clicks.)
What is Google AdWords?
Google AdWords is a popular paid marketing tool. With AdWords, you set a budget, select keywords, and publish ads that appear on Google search results pages relevant to your keywords. AdWords collects data about campaigns that businesses can use to measure their effectiveness.
What is Azure SQL Data Warehouse?
Azure SQL Data Warehouse is a cloud-based petabyte-scale columnar database service with controls to manage compute and storage resources independently. It offers encryption of data at rest and dynamic data masking to mask sensitive data on the fly, and it integrates with Azure Active Directory. It can replicate to read-only databases in different geographic regions for load balancing and fault tolerance.
Getting data out of AdWords
Google provides a SOAP API for AdWords. The first step of getting your AdWords data into your data warehouse is pulling the data off of Google's servers by using the AdWords API's Reporting features. This is a subset of the API's functionality, which also includes the ability to manage ads.
You can also link your Google Analytics and Google AdWords accounts to allow the data to cross-pollinate. This can provide richer reporting due to the breadth of knowledge that exists in Google Analytics about the people who may have viewed or clicked your ads.
You can extract granular data from AdWords API reports, allowing you to see things like impressions, clickthrough rates, and CPC broken out by time period.
Loading data into Azure SQL Data Warehouse
SQL Data Warehouse provides a multi-step process for loading data. After extracting the data from its source, you can move it to Azure Blob storage or Azure Data Lake Store. You can then use one of three utilities to load the data:
- AZCopy uses the public internet.
- Azure ExpressRoute routes the data through a dedicated private connection to Azure, bypassing the public internet by using a VPN or point-to-point Ethernet network.
- The Azure Data Factory (ADF) cloud service has a gateway that you can install on your local server, then use to create a pipeline to move data to Azure Storage.
From Azure Storage you can load the data into SQL Data Warehouse staging tables by using Microsoft's PolyBase technology. You can run any transformations you need while the data is in staging, then insert it into production tables. Microsoft offers documentation for the whole process.
Keeping AdWords data up to date
So, now what? You've built a script that pulls data from AdWords and loads it into your data warehouse, but what happens tomorrow when you have thousands of new impressions?
The key is to build your script in such a way that it can also identify incremental updates to your data. If you can identify some fields that auto-increment, you could use them to give your script the ability to recognize new data. You can then set your script up as a cron job or continuous loop to keep pulling down new data as it appears.
Easier and faster alternatives
If all this sounds a bit overwhelming, don’t be alarmed. If you have all the skills necessary to go through this process, chances are building and maintaining a script like this isn’t a very high-leverage use of your time.
Thankfully, products like Stitch were built to solve this problem automatically. With just a few clicks, Stitch starts extracting your AdWords data via the API, structuring it in a way that is optimized for analysis, and inserting that data into your Azure SQL Data Warehouse data warehouse.