How To Get Data From Google AdWords Using SSIS ZappySys Blog
How To Get Data From Google AdWords Using SSIS ZappySys Blog
Home Products Blog REST API Integration FREE SSIS Tasks About Us Support
Home » Google API » How to get data from Google AdWords using SSIS
Contents [hide]
1 Introduction
2 SSIS Tasks/Connectors discussed in this Article
3 Two different ways to get Google AdWords Data in SSIS
70+ high performance, drag and
4 Google AdWords API Integration Example Screenshot drop connectors/tasks for SSIS
5 Step-By-Step Tutorial
6 Register for Developer Token to access AdWords account data using API
7 Find your Client ID Download Read More
8 Connect to Google AdWords API using OAuth
9 Extract data from Google AdWords using SOAP API Calls
10 SOAP Response Paging / Looping
11 Read Google AdWords data and Load into SQL Server
12 Write data / Manage AdWords Account via REST API Calls
12.1 Create Ad under specific AdGroup
13 Methods for Creating new records
14 Methods for Reading AdWords data ODBC Drivers for REST API,
14.1 Get Method (XML Selector) JSON, XML, SOAP, OData ...
14.2 Query Method (AWQL Query – SQL like query language) Integrate inside Apps like Power BI,
15 Call AdWords Reports API – Download Campaign Performance data Tableau, SSRS, Excel, Informatica
16 Download Example SSIS Package and more...
17 Conclusion
17.1 Share this:
17.2 Related Download Read More
Introduction
Recent Posts
Google AdWords is one of the most popular Advertise Platforms. In this article, you will learn how to get data from Google
How to Make UPS API call in SSIS
AdWords by calling Google AdWords Web Service method and using drag and drop SSIS XML/SOAP connector (No
Download AdWords report using Google
coding required :)). Google AdWords Web Services allows retrieving various data such as account info, campaigns; as well Ads API, ODBC, and XML Driver
as writing data, such as creating a campaign, add a keyword. Basically, it allows controlling your AdWords account How to Pivot CSV Data in SSIS
programmatically instead of using the AdWords dashboard. For demo purposes, we will get data from Google AdWords How to migrate Postman API call to SSIS
Account and load it into Microsoft SQL Server (but you can use this technique to save any supported targets in SSIS (e.g. / ODBC PowerPack
Excel, FlatFile, Oracle, MySQL, IBM DB2, etc.). SSIS PowerPack v2.9.8 released
If you desire to download a report from AdWords, you must follow a different approach described in an article on how to
download AdWords report. It describes how to download a report using ODBC and XML Driver but the concepts introduced
Categories
there can be applied to SSIS as well.
Announcements (10)
If you are looking for a similar article for Google DoubleClick for Publisher (Google DFP) then check this article.
Cloud Computing (11)
You will also learn how to create Google Ads or modify any other objects by calling SOAP API using SSIS REST API Task. AWS (Amazon Web Services) (10)
Redshift (5)
S3 (Simple Storage Service) (5)
SSIS Tasks/Connectors discussed in this Article Google API (11)
ODBC PowerPack (52)
In this article we will use following Connector(s) and Connection Manager to archive full data integration with Google
ODBC App Integration (24)
AdWords.
ETL – Informatica (3)
Following SSIS Connectors support OAuth Connectivity. When you use below connectors no coding required to pull data ETL – Pentaho Kettle (1)
ETL – Talend (1)
from any OAuth enabled services (e.g. Twitter, Facebook, LinkedIn).
Reporting – Google Sheet (1)
Reporting – Microsoft Access (4)
Reporting – Microsoft Excel (1)
REST API Task
Reporting – Microsoft Power BI (8)
Reporting – Microsoft SSRS (2)
OAuth Connection Manager Reporting – MicroStrategy (1)
Reporting – Qlik (1)
Reporting – Tableau (2)
XML Source (REST API, SOAP Call or File data) ODBC Drivers (45)
We're offline
LeaveAmazon
a messageS3 CSV Driver (2)
Amazon S3 JSON Driver (2)
Two different ways to get Google AdWords Data in SSIS Amazon S3 XML Driver (2)
Azure Blob CSV Driver (1)
There are two ways you can extract Google AdWords data in SSIS. Azure Blob JSON Driver (1)
Azure Blob XML Driver (1)
1. Use Google Analytics Source (For more info see this article) (Consume AdWords data using Google Analytics
CSV File / REST API Driver (1)
REST API)
JSON File / REST API Driver (31)
2. Use XML Source along with OAuth connection manager (Consume AdWords data using SOAP API) XML File / SOAP API Driver (22)
ODBC Gateway (16)
In this article we will only discuss Approach #2. For approach #1 refer see this link ODBC Programming (14)
C# (CSharp) (2)
Advantage of #2 is you get total control of full API set for AdWords but you have to do lot more manual work. For Approach
JAVA (1)
#1 is lot simpler but you get access to limited reports (Dimensions and Metrics).
PHP (1)
PowerShell (1)
Google AdWords API Integration Example Screenshot Python (2)
T-SQL (SQL Server) (9)
Below is screenshot of sample package discussed in this article (Download from here). As you can see we tried to REST API (28)
demonstrate Reading data and Managing data (e.g. Create Ad) in the same package. You can extend these technique to REST API Integration (60)
perform any type of operations in Google AdWords or similar service such as DoubleClick for Publisher SSIS PowerPack (177)
SSIS Components (126)
REST Connector (3)
SSIS Amazon DynamoDB
Destination (1)
SSIS Amazon DynamoDB Src (1)
SSIS Amazon Redshift Destination
(1)
SSIS Amazon Redshift Source (1)
SSIS Amazon S3 CSV Dest (1)
SSIS Amazon S3 CSV Source (2)
SSIS Amazon S3 JSON Source (2)
SSIS Amazon S3 XML Source (1)
SSIS Amazon SQS Destination (1)
SSIS Amazon SQS Source (1)
SSIS Azure Blob CSV Destination
(1)
SSIS Azure Blob CSV Source (1)
SSIS Azure Blob JSON Source (1)
SSIS Azure Blob XML Source (1)
SSIS Azure Queue Storage
Destination (2)
SSIS Azure Queue Storage Source
Google AdWords API Integration Example – Create Ad, Get Accounts, Get Campaigns, Get Ad (2)
Groups, Get Ads (Extract AdWords data via SOAP API, Read data using Selector Method or use SSIS Azure Table Storage
AWQL query language) Destination (1)
SSIS Azure Table Storage Source
(1)
Step-By-Step Tutorial SSIS CSV File Destination (2)
SSIS CSV Generator Transform (2)
Here are few high level steps you will have to perform to extract data from Google AdWords API using SSIS. This section SSIS CSV Parser Transform (1)
assumes you have ClientID and Developer Token to access data. if you don’t have that then read next 2-3 sections. SSIS CSV Source (3)
SSIS Dummy Data Source (1)
1. Download and install SSIS PowerPack from here SSIS Dynamics CRM Destination (2)
2. Create new SSIS Project SSIS Dynamics CRM Source (2)
3. From SSIS toolbox drag DataFlow Task and go to dataflow designer SSIS Excel Destination (2)
4. From toolbox of drag ZS XML Source SSIS Excel Source (4)
5. Double click XML Source to configure it SSIS Google Analytics Source (3)
6. Specify API URL from which you want to read data SSIS HTML Table Source (2)
Example : https://adwords.google.com/api/adwords/mcm/v201509/ManagedCustomerService SSIS JSON File Destination (2)
7. Now check Use Credentials check box and select New ZS-OAuth connection manager. SSIS JSON Generator Transform (7)
8. On connection manager UI you can select Google from Provider Dropdown. SSIS JSON Parser Transform (4)
9. Under Scopes enter following (Scope is basically permission) SSIS JSON Source (File/REST) (55)
SSIS MongoDB Destination (3)
https://www.googleapis.com/auth/adwords SSIS MongoDB Source (6)
SSIS PostgreSQL Destination (1)
SSIS PostgreSQL Source (2)
10. Now click Generate Token and when prompted login and in the last step Accept.
SSIS Recordset Destination (1)
11. If everything went ok then you will see AccessToken and RefreshToken populated.
SSIS Salesforce Destination (2)
12. Click Test connection and close the UI by clicking OK
SSIS Salesforce Source (2)
13. Now on XML Source connector Select HTTP Request Method as POST SSIS Script Component (1)
14. In the Request Body click edit and enter request as below (Replace DEV_TOKEN and CLIENT_ID placeholders SSIS Set Variable Transform (1)
below) SSIS SFTP CSV Source (1)
<?xml version="1.0" encoding="utf-8"?> SSIS SFTP JSON Source (1)
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" SSIS SFTP XML Source (1)
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SSIS Template Transform (9)
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
SSIS Trash Destination (2)
<soap:Header>
<RequestHeader xmlns="https://adwords.google.com/api/adwords/mcm/v201605"> SSIS Upsert Destination (6)
<developerToken>ENTER_YOUR_DEV_TOKEN_HERE</developerToken> SSIS WEB API Destination (11)
<clientCustomerId>ENTER_YOUR_CLIENT_ID_HERE</clientCustomerId> SSIS XML File Destination (1)
<userAgent>ZappySys SSIS PowerPack v1</userAgent>
SSIS XML Generator Transform (4)
</RequestHeader>
</soap:Header> SSIS XML Parser Transform (3)
<soap:Body> SSIS XML Source (File / SOAP) (18)
<get xmlns="https://adwords.google.com/api/adwords/mcm/{{User::ApiVersion}}"> SSIS Connection Manager (29)
<serviceSelector>
HTTP Connection (6)
<fields>CustomerId</fields>
<fields>Name</fields> SSIS Amazon S3 Connection (2)
</serviceSelector> SSIS Azure Blob Connection (3)
</get> SSIS Excel Connection (2)
</soap:Body>
</soap:Envelope>
SSIS OAuth Connection (10)
SSIS PostgreSql Connection (4)
SSIS SFTP / FTP Connection (2)
SSIS Tasks (75)
SSIS Advanced File System Task
If you are wondering how did we get above XML fragment for Request Body then Check this article on how to
(9)
use SoapUI (free 3rd party tool) to create SOAP request Bodyfrom WSDL. Google AdWords has many API
SSIS Amazon DynamoDB
endpoints for different service. For each service you have different Api URL and different WSDL. In the next
ExecuteSQL Task (1)
section you can learn how to create correct SOAP Body (for POST) using SoapUI tool. SSIS Amazon Redshift ExecuteSQL
Task (1)
For example if you are calling ManagedCustomerService API for version v201609 then your help page URL
SSIS Amazon Storage Task (9)
would be like this
SSIS Azure Blob Storage Task (8)
https://developers.google.com/adwords/api/docs/reference/v201609/ManagedCustomerService
SSIS CSV Export Task (3)
And on the same page you will see WSDL link below SSIS Download File Task (1)
https://ads.google.com/apis/ads/publisher/v201702/NetworkService?wsdl SSIS Excel Export Task (3)
SSIS ForEach Loop Task (1)
(Just download that WSDL XML and save to local disk then use with SoapUI to generate XML body to submit
SSIS JSON Export Task (2)
for any DFP API call.)
SSIS JSON Parser Task (2)
See this link for more information (Its for Google DoubleClick Ad Platform but you will get an idea) SSIS Logging Task (6)
SSIS MongoDB ExecuteSQL (4)
SSIS PostgreSQL ExecuteSQL Task
15. Go to Array handling tab at the bottom and enter text : ns2:entries – By doing this we will treat <ns2:entries> (1)
node as array eventhough only one entry found in response (By default content with multiple records treated as SSIS Regex Parser Task (2)
array). SSIS Report Generator (SSRS) (1)
SSIS REST API Task (33)
SSIS SFTP Task (5)
SSIS Timer Task (1)
SSIS XML Export Task (2)
SSIS Zip File Task (1)
SSIS Tips & How-Tos (11)
Tools (3)
Uncategorized (6)
Handling Array Element Nodes in SOAP Response
Tags
16. On the filter expression click edit and highlight entries node and click ok. This will produce something like below in
filter textbox access
amazon
api
API Integration
aws
azure
CSV
Destination
excel
$.soap:Envelope.soap:Body.ns2:getResponse.ns2:rval.ns2:entries[*]
json
export
fiddler
google
google api
json source
MongoDB
oauth
17. Now click preview to see actual data. oauth2
odata
odbc
pagination
paging
18. Click OK to save UI. Now you can connect source to target such as SQL Server or Trash Destination.
power bi
redshift
regex
rest
rest
NOTE: in above example we used v201605 API version but change it to latest if this API is no more valid. Google api
s3
salesforce
soap
SoapUI
source
expires API version pretty often so keep that in mind if you get depreciated API version error. SQL
sql server
ssis
SSIS JSON
Generator Transform
ssis json source
Register for Developer Token to access AdWords account data using API SSIS PowerPack
ssis
rest api task
ssis xml source
Task
First important step to access any Google AdWords Account is request developer token. Click this link for step by step
information. Watch short vide to get overview on entire process to access data via API.
upsert
xml
xml source
ZappySys
Next thing you will need to know is your ClientID. Most of API Requests will require your ClientID. Perform following steps to November 2019
find your ClientID. October 2019
September 2019
Login to your AdWords Account using email address. At the top you will see your client ID as below screenshot. August 2019
July 2019
How to find ClientID of your Google AdWords Account (Useful for making SOAP API Calls) June 2019
May 2019
April 2019
March 2019
February 2019
Connect to Google AdWords API using OAuth January 2019
December 2018
Connecting to any Google API will require OAuth 2.0. SSIS PowerPack has Protocol so you can easily extract data from API November 2018
without coding complex token extract/renew workflow. Such things usually requires some sort of programming but in our October 2018
case you will do few clicks as described in Step-By-Step section earlier. September 2018
August 2018
Here is the screenshot of OAuth Connection Manager. July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
April 2017
March 2017
February 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
Connecting to Google AdWords API using OAuth 2.0 in SSIS (Consuming XML/SOAP API)
June 2016
May 2016
April 2016
March 2016
February 2016
Extract data from Google AdWords using SOAP API Calls January 2016
December 2015
When you define filter expression you can check/uncheck “Include Parent Columns” setting. For AdWords SOAP Api you can November 2015
uncheck so you only extract columns from rvals node in XML Response. October 2015
September 2015
Extract data from Google AdWords SOAP/XML Response August 2015
REST API Pagination – Passing PageNumber inside POST Body (Example: Google
AdWords SOAP Api)
Configure REST API Pagination – using Page Number via POST Body Method
Extract data from Google AdWords and load into SQL Server table using SSIS
Notice we have used few placeholders to make things dynamic using SSIS Variables. Once REST API Task is executed you
will see new ad created.
Creating Google AdWords Ad using SOAP/XML API in SSIS (REST API Task)
Verify Google Ad created programmatically using SOAP/XML API Call (SSIS REST API Task)
To learn more about which Columns you can use inside your AWQL Query Click here. Note that each service support
different fields for Select Clause, Where Clause and Order By Clause. AWQL language can be also used to query
Predefined AdWords Reports. The only difference is .. FROM clause is required when you query Reports.
Conclusion
Google AdWords data integration can be very challenging without right set of tools. SSIS PowerPack certainly makes it easy
when you have to extract/manage Google AdWords data. Innovative drag and drop approach gives you various options to
cover simple or most advanced scenarios without relying on any Programming language (e.g. C#, Java, Python, Ruby etc).
Share this:
Related
Download AdWords report using Get data from Google Analytics in How to call Google DFP API with
Google Ads API, ODBC, and XML SSIS using REST API Call SSIS - DoubleClick
Driver January 8, 2016 February 14, 2017
October 24, 2019 In "Google API" In "Google API"
In "ODBC Drivers"
Posted in Google API, REST API Integration and tagged AdWords, API Integration, DFP, google, google analytics, google api, Google DoubleClick,
oauth, rest api, soap, ssis, SSIS PowerPack, xml, xml source.
2 Comments
Pingback: Calling SOAP Web Service in SSIS (XML Source) | ZappySys Blog
Pingback: Get data from Workday in SSIS using SOAP or REST API | ZappySys Blog
F G Li Pi T Y
a o n nt wi o
k tt