Google Ads Connector for InformaticaIn this article you will learn how to quickly and efficiently integrate Google Ads data in Informatica without coding. We will use high-performance Google Ads Connector to easily connect to Google Ads and then access the data inside Informatica. Read / write Google Ads data inside your app (e.g. Campaigns, Ad Groups, Keywords, Spending, Performance); perform many Google Ads operations without coding, just using easy to use high performance API Connector for Google Ads Let's follow the steps below to see how we can accomplish that! Google Ads Connector for Informatica is based on ZappySys API Driver which is part of ODBC PowerPack. It is a collection of high-performance ODBC drivers that enable you to integrate data in SQL Server, SSIS, a programming language, or any other ODBC-compatible application. ODBC PowerPack supports various file formats, sources and destinations, including REST/SOAP API, SFTP/FTP, storage services, and plain files, to mention a few. |
Connect to Google Ads in other apps
|
How to read API data in Informatica (Call JSON / XML SOAP Service)
How to write data to API (POST) in Informatica (Call JSON / XML SOAP Service)
Introduction
JSON / REST API is becoming more and more popular each day as everyone embrace cloud-centric services. This article is primarily focused on Informatica users who want to access Google Ads data or may be other API Integration in Informatica. However many tips and techniques described in this article will help you to understand how to integrate Google Ads / XML SOAP / JSON / REST API in other ETL / Reporting apps such as Tableau, Power BI, SSRS, Talend, Excel and many more.
After going through this article you will learn how to Read Google Ads / JSON / REST API data in Informatica and understand the concept of JSON / REST API. We will go through many screenshots and step-by-step examples to demonstrate Google Ads or REST API integration in Informatica PowerCenter.
XML / JSON can come from a local file or REST API service (internal or public) so we will include both examples in this article (i.e. Read JSON files in Informatica, Import REST API in Informatica). So let’s get started. Next article will focus on how to write data to API in Informatica (POST / PUT data)
Requirements
This article assumes that you have full filled following basic requirements.
- Download Install ZappySys ODBC PowerPack (API Driver for Google Ads included)
- Install Informatica PowerCenter Client Tools (e.g. Workflow and Mapping Designers)
- Access to a Relational database such as SQL Server (or use any of your choice e.g. Oracle, MySQL, DB2 ). If nothing available then you can use flat file target.
High level Steps for Import Google Ads data using Informatica (Read Google Ads API data)
Before we dive deep to learn how to load Google Ads data in Informatica (i.e. Google Ads to SQL Table), Here the summary of high-level steps you need to perform to import Google Ads in Informatica (same steps for Import JSON / XML / REST API).
- Download and Install ZappySys API Driver (for connecting to Google Ads)
- Create ODBC DSN using ZappySys API driver and choose Google Ads Connector during Wizard
- Create Relational > ODBC Connection in Informatica Workflow designer (Point to DSN we created in the previous step)
- Import Google Ads Source Definition in the Informatica Mapping Designer > Sources Tab
- Import Target Table Definition in the Informatica Mapping Designer > Targets Tab
- Create source to target mapping in Mappings tab
- Save mapping (name m_API_to_SQL_Load )
- Create Session using the mapping we created in the previous step
- Save Workflow and execute to load Google Ads data into SQL Table. Verify your data and log.
Video Tutorial – Read any API / JSON data in Informatica (Load Google Ads to SQL Table)
Below video is not about Google Ads API but its showing API access in general (for any API). By watching following ~5 min video can learn steps listed in this article to load JSON API data into SQL Server Table using ZappySys JSON Driver. You can go though full article to learn many useful details not covered in this video.
Getting Started – Import Google Ads to SQL Server in Informatica
Now let’s get started. For example purpose, we will read data from Google Ads and load data into SQL Server Table using Informatica Workflow.
Create ODBC Data Source (DSN) based on ZappySys API Driver
Step-by-step instructions
To get data from Google Ads using Informatica we first need to create a DSN (Data Source) which will access data from Google Ads. We will later be able to read data using Informatica. Perform these steps:
-
Install ZappySys ODBC PowerPack.
-
Open ODBC Data Sources (x64):
-
Create a User data source (User DSN) based on ZappySys API Driver
ZappySys API Driver-
Create and use User DSN
if the client application is run under a User Account.
This is an ideal option
in design-time , when developing a solution, e.g. in Visual Studio 2019. Use it for both type of applications - 64-bit and 32-bit. -
Create and use System DSN
if the client application is launched under a System Account, e.g. as a Windows Service.
Usually, this is an ideal option to use
in a production environment . Use ODBC Data Source Administrator (32-bit), instead of 64-bit version, if Windows Service is a 32-bit application.
-
Create and use User DSN
if the client application is run under a User Account.
This is an ideal option
-
When the Configuration window appears give your data source a name if you haven't done that already, then select "Google Ads" from the list of Popular Connectors. If "Google Ads" is not present in the list, then click "Search Online" and download it. Then set the path to the location where you downloaded it. Finally, click Continue >> to proceed with configuring the DSN:
GoogleAdsDSNGoogle Ads -
Now it's time to configure the Connection Manager. Select Authentication Type, e.g. Token Authentication. Then select API Base URL (in most cases, the default one is the right one). More info is available in the Authentication section.
User accounts represent a developer, administrator, or any other person who interacts with Google APIs and services. User accounts are managed as Google Accounts, either with Google Workspace or Cloud Identity. They can also be user accounts that are managed by a third-party identity provider and federated with Workforce Identity Federation. [API reference]
Steps how to get and use Google Ads credentials
Follow these steps on how to create Client Credentials (User Account principle) to authenticate and access Google Ads API in SSIS package or ODBC data source:
WARNING: If you are planning to automate processes, we recommend that you use a Service Account authentication method. In case, you still need to use User Account, then make sure you use a system/generic account (e.g.automation@my-company.com
). When you use a personal account which is tied to a specific employee profile and that employee leaves the company, the token may become invalid and any automated processes using that token will start to fail.Manager Account Setup - Obtain Developer Token
To access Google Ads API (your data or someone else data) you must perform the following steps (high level). Detailed steps listed in the next sections.
- Create a Google Ads Manager account (formally known as MCC).
- Apply for Production data access (Upgrade Developer Token access Level to Basic).
- Link manager account with Google Ads Account.
- Create a new Project and obtain Client Id and Client Secret
Step-1: Create a Google Ads Manager account (formally known as MCC)
Very first step to access Google Ads API for your own account or someone else account, you will need something called Google Manager Account (formally known as MCC). It will look like a Normal Google Ads Account with some difference so dont get confused if you see similar interface as Ads account.
Click here to see detailed instructions on how to create a manager account. Once you created a manager account, you can login or switch between Ads account and Manager account like below. You can identify manager account using "Manager" word next to the account id when you click Profile dropdown.Step-2: Obtain Developer Token
Once you have created and logged in to your Google Ads Manager Account (formally known as MCC) we are ready for the next step which is obtain Developer Token. To access Google Ads API you need to pass developer token in each API call. By default Developer Token is only allowed to access Sandbox (Test) account. If you like to access Production data (Live Ads Account) then you must apply for Basic Access by clicking link under Access Level (See next section for information).
Here is how to can obtain your Developer Token.- Log in as Manager account (Or change Top-Right Profile > Choose Manager account ID
- Click on Admin icon
- Click on API Center (This option will be missing if you are logged in to Regular Ads account as Client and not using Manager Account (MMC)
- Expand Access Level, Click Apply for Basic Access if it says "Test". By default Developer Token is created with Test Account access only. To access Production Ads account you must apply for higher access level. Must be Basic or Standard (not Test). After click the link you will see form with few questions, please fill out that and submit the form. Apploval process may take 3-5 days (or longer in some cases if you did not provide enough information).
- If your token is already approved for the basic access then copy the token and paste on the Google Ads Connector - Connection UI (For Developer Token property)
Link Manager Account to Google Ads Account
After you have manager account ready, next step is to link manager account with Google Ads Account. You have to send invitation from Manager account to access Google Ads account (it can be your own account or someone else). Here is how to send invite to link Google Ads account.- Log in as Manager account (Or change Top-Right Profile > Choose Manager account ID
- Click on Accounts icon > Sub-account settings > Send Link Request
- Click on Add Sign (+) and select + Link existing account option
- When prompted enter Account Id(s) you like to link with this Manager Account.
- Click Send Request. You can find Ad Account Id usually at the Top-Right corner after you login to the Google Ads account.
- Now ask Google Ads Account owner to check email. Click Accept Invitation link in the email (If prompted login as Google Ads Account owner).
-OR-
Another way to see Invitation, Login to Google Ads account (Or Switch from the Top-Right corner by clicking Profile icon). Go to Admin icon > Access and security > Managers Tab. Find the pending invitation and click ACCEPT. - That's it. Now your Manager account is linked to the Google Ads account
Obtain ClientId and ClientSecret
Step-1: Create project
This step is optional, if you already have a project in Google Cloud and can use it. However, if you don't, proceed with these simple steps to create one:
-
First of all, go to Google API Console.
-
Then click Select a project button and then click NEW PROJECT button:
-
Name your project and click CREATE button:
-
Wait until the project is created:
- Done! Let's proceed to the next step.
Step-2: Enable Google Ads API
In this step we will enable Google Ads API:
-
Select your project on the top bar:
-
Then click the "hamburger" icon on the top left and access APIs & Services:
-
Now let's enable several APIs by clicking ENABLE APIS AND SERVICES button:
-
In the search bar search for
Ads
and then locate and select Google Ads API: -
Enable Google Ads API:
- Done! Let's proceed to the next step.
Step-3: Create OAuth application
-
First of all, click the "hamburger" icon on the top left and then hit VIEW ALL PRODUCTS:
-
Then access Google Auth Platform to start creating an OAuth application:
-
Start by pressing GET STARTED button:
-
Next, continue by filling in App name and User support email fields:
-
Choose Internal option, if it's enabled, otherwise select External:
-
Optional step if you used
Internal
option in the previous step. Nevertheless, if you had to useExternal
option, then click ADD USERS to add a user: -
Then add your contact Email address:
-
Finally, check the checkbox and click CREATE button:
- Done! Let's create Client Credentials in the next step.
Step-4: Create Client Credentials
-
In Google Auth Platform, select Clients menu item and click CREATE CLIENT button:
-
Choose
Desktop app
as Application type and name your credentials: -
Continue by opening the created credentials:
-
Finally, copy Client ID and Client secret for the later step:
- Done! We have all the data needed for authentication, let's proceed to the last step!
Step-5: Configure connection
-
Now go to SSIS package or ODBC data source and use previously copied values in User Account authentication configuration:
- In the ClientId field paste the Client ID value.
- In the ClientSecret field paste the Client secret value.
- In the DeveloperToken field paste the Developer Token value.
-
Press Generate Token button to generate Access and Refresh Tokens.
-
Finally, click Test Connection to confirm the connection is working.
- Done! Now you are ready to use Google Ads Connector!
Fill in all required parameters and set optional parameters if needed:
GoogleAdsDSNGoogle AdsUser Account [OAuth]https://googleads.googleapis.com/[$ApiVersion$]Required Parameters UseCustomApp Fill-in the parameter... CustomerId (without dash e.g. 2125557752) Fill-in the parameter... DeveloperToken Fill-in the parameter... Optional Parameters ClientId ClientSecret Scope https://www.googleapis.com/auth/adwords Login CustomerId (without dash e.g. 2125557752) Linked CustomerId (without dash e.g. 2125557752) API Version v19 RetryMode RetryWhenStatusCodeMatch RetryStatusCodeList 429 RetryCountMax 5 RetryMultiplyWaitTime True Redirect URL (Only for Web App) Service accounts are accounts that do not represent a human user. They provide a way to manage authentication and authorization when a human is not directly involved, such as when an application needs to access Google Cloud resources. Service accounts are managed by IAM. [API reference]
Steps how to get and use Google Ads credentials
To access Google Ads API (your data or someone else data) you must perform the following steps (high level). Detailed steps listed in the next sections.
- Create a Manager account.
- Apply for Production data access (Upgrade Developer Token access Level to Basic).
- Link manager account with Google Ads Account.
- Inside Manager account apply for Basic API Access level so you can use Developer Token to access Live data (Production Ads account). Without Basic access level Developer Token can be only used for Test / Sandbox Ads account.
- Create a new Project and obtain Client Id and Client Secret
Manager Account Setup - Obtain Developer Token
To access Google Ads API (your data or someone else data) you must perform the following steps (high level). Detailed steps listed in the next sections.
- Create a Google Ads Manager account (formally known as MCC).
- Apply for Production data access (Upgrade Developer Token access Level to Basic).
- Link manager account with Google Ads Account.
- Create a new Project and obtain Service Account details
Step-1: Create a Google Ads Manager account (formally known as MCC)
Very first step to access Google Ads API for your own account or someone else account, you will need something called Google Manager Account (formally known as MCC). It will look like a Normal Google Ads Account with some difference so dont get confused if you see similar interface as Ads account.
Click here to see detailed instructions on how to create a manager account. Once you created a manager account, you can login or switch between Ads account and Manager account like below. You can identify manager account using "Manager" word next to the account id when you click Profile dropdown.Step-2: Obtain Developer Token
Once you have created and logged in to your Google Ads Manager Account (formally known as MCC) we are ready for the next step which is obtain Developer Token. To access Google Ads API you need to pass developer token in each API call. By default Developer Token is only allowed to access Sandbox (Test) account. If you like to access Production data (Live Ads Account) then you must apply for Basic Access by clicking link under Access Level (See next section for information).
Here is how to can obtain your Developer Token.- Log in as Manager account (Or change Top-Right Profile > Choose Manager account ID
- Click on Admin icon
- Click on API Center (This option will be missing if you are logged in to Regular Ads account as Client and not using Manager Account (MMC)
- Expand Access Level, Click Apply for Basic Access if it says "Test". By default Developer Token is created with Test Account access only. To access Production Ads account you must apply for higher access level. Must be Basic or Standard (not Test). After click the link you will see form with few questions, please fill out that and submit the form. Apploval process may take 3-5 days (or longer in some cases if you did not provide enough information).
- If your token is already approved for the basic access then copy the token and paste on the Google Ads Connector - Connection UI (For Developer Token property)
Link Manager Account to Google Ads Account
After you have manager account ready, next step is to link manager account with Google Ads Account. You have to send invitation from Manager account to access Google Ads account (it can be your own account or someone else). Here is how to send invite to link Google Ads account.- Log in as Manager account (Or change Top-Right Profile > Choose Manager account ID
- Click on Accounts icon > Sub-account settings > Send Link Request
- Click on Add Sign (+) and select + Link existing account option
- When prompted enter Account Id(s) you like to link with this Manager Account.
- Click Send Request. You can find Ad Account Id usually at the Top-Right corner after you login to the Google Ads account.
- Now ask Google Ads Account owner to check email. Click Accept Invitation link in the email (If prompted login as Google Ads Account owner).
-OR-
Another way to see Invitation, Login to Google Ads account (Or Switch from the Top-Right corner by clicking Profile icon). Go to Admin icon > Access and security > Managers Tab. Find the pending invitation and click ACCEPT. - That's it. Now your Manager account is linked to the Google Ads account
Obtain ClientId and ClientSecret
Step-1: Create project
This step is optional, if you already have a project in Google Cloud and can use it. However, if you don't, proceed with these simple steps to create one:
-
First of all, go to Google API Console.
-
Then click Select a project button and then click NEW PROJECT button:
-
Name your project and click CREATE button:
-
Wait until the project is created:
- Done! Let's proceed to the next step.
Step-2: Enable Google Ads API
In this step we will enable Google Ads API:
-
Select your project on the top bar:
-
Then click the "hamburger" icon on the top left and access APIs & Services:
-
Now let's enable several APIs by clicking ENABLE APIS AND SERVICES button:
-
In the search bar search for
ads
and then locate and select Google Ads API: -
Enable Google Ads API:
- Done! Let's proceed to the next step.
Step-3: Create Service Account
Use the steps below to create a Service Account in Google Cloud:
-
First of all, go to IAM & Admin in Google Cloud console:
-
Once you do that, click Service Accounts on the left side and click CREATE SERVICE ACCOUNT button:
-
Then name your service account and click CREATE AND CONTINUE button:
-
Continue by clicking Select a role dropdown and start granting service account Project Viewer roles:
-
Find Project group and select Viewer role:
-
Finish adding roles by clicking CONTINUE button:
You can always add or modify permissions later in IAM & Admin. -
Finally, in the last step, just click button DONE:
-
Done! We are ready to add a Key to this service account in the next step.
Step-4: Add Key to Service Account
We are ready to add a Key (JSON or P12 key file) to the created Service Account:
-
In Service Accounts open newly created service account:
-
Next, copy email address of your service account for the later step:
-
Continue by selecting KEYS tab, then press ADD KEY dropdown, and click Create new key menu item:
-
Finally, select JSON (Engine v19+) or P12 option and hit CREATE button:
- Key file downloads into your machine. We have all the data needed for authentication, let's proceed to the last step!
Step-5: Give Permissions to Service Account
Now it's time to grant permission to Service Account we just created:
- Login to https://ads.google.com/aw/settings/account with Google Ads account credentials (If propmpted choose your Ads account).
-
Go to Admin section, Access and security, Click on Users tab.
- Click on Add Icon (+) and enter service account email address which you like to use for data access and choose permissions.
- That's it! Let's proceed to the configuration!
Step-6: Configure connection
-
Now go to SSIS package or ODBC data source and configure these fields in Service Account authentication configuration:
- In the Service Account Email field paste the service account Email address value you copied in the previous step.
- In the Service Account Private Key Path (i.e. *.json OR *.p12) field use downloaded key file path.
- Done! Now you are ready to use Google Ads Connector!
Each Google API Console project can be associated with the developer token from only one manager account. Once you make a Google Ads API request, the developer token is permanently paired to the Google API Console project. If you don't use a new Google API Console project, you'll get a DEVELOPER_TOKEN_PROHIBITED error when making a request. Unfortunatly there is no other way to Unlink old Developer Token from the API Project, so for now just create a new Project as a workaround to fix this error.Fill in all required parameters and set optional parameters if needed:
GoogleAdsDSNGoogle AdsService Account [OAuth]https://googleads.googleapis.com/[$ApiVersion$]Required Parameters Service Account Email Fill-in the parameter... Service Account Private Key Path (i.e. *.json OR *.p12) Fill-in the parameter... CustomerId (without dash e.g. 2125557752) Fill-in the parameter... DeveloperToken Fill-in the parameter... Optional Parameters Scope https://www.googleapis.com/auth/adwords Login CustomerId (without dash e.g. 2125557752) Linked CustomerId (without dash e.g. 2125557752) API Version v19 RetryMode RetryWhenStatusCodeMatch RetryStatusCodeList 429 RetryCountMax 5 RetryMultiplyWaitTime True Impersonate As (Google account email address) -
Once the data source has been configured, you can preview data. Select the Preview tab and use settings similar to the following to preview data:
-
Click OK to finish creating the data source.
Video instructions
Create Connection in Informatica Workflow Designer
Once you create DSN using API Driver our next step is to define a connection for Google Ads source in Informatica PowerCenter Workflow designer.
- Open Workflow designer [W] icon
- Goto Connections > Relational
- Click New and select ODBC
- Now on the ODBC connection setup enter connection name, some fake userid / password (this is a required field but its ignored by JSON Driver)
-
In the Connection String field enter the exact same name of DSN (Open ODBC Data Sources UI to confirm)
Configure Google Ads connection in Informatica for REST API – Using ZappySys API Driver
- Click OK to close the connection properties.
That’s it. Now we ready to move to next step (define source and target in Mapping Designer).
Import Google Ads Source Definition in Informatica Mapping Designer
Now let’s look at steps to import Google Ads table definition.
- Open Informatica Mapping Designer (Click [D] icon)
- Click on Source Icon to switch to Sources designer
- From the top menu > Click on Sources > Import from Database …
- Select ODBC data source from the dropdown (Find out DSN we created earlier to use as JSON Source)
-
Click Connect button to get a list of tables. Any array node is listed as a table. Also, you will see array node with parent columns (e.g. value_with_parent). You may get some warning like below but they are harmless so just ignore by clicking OK.
DLL name entry missing from C:\Informatica\PowerCenter8.6.1\client\bin\powrmart.ini Section = ODBCDLL Entry = ZappySys JSON Driver
—————————————————-
Using EXTODBC.DLL to support ZappySys JSON Driver. For native support of ZappySys JSON Driver make an entry in the .ini file. - Select Table you wish to get (You can filter rows by custom SQL query. We will see later in this article how to do)
- Optionally once table structure is imported you can rename it
- That’s it, we are now ready to perform similar steps to import Target table structure in the next section.
Import SQL Server Target Definition in Informatica Mapping Designer
Now let’s look at steps to import Target table definition (very similar to the previous section, the only difference is this time we will select DSN which points to SQL Server or any other Target Server).
Now lets look at steps to import target table definition in Informatica mapping designer.
- In the Mapping Designer, Click on Target Icon to switch to Target designer
- From the top menu > Click on Targets > Import from Database …
- Select DSN for your Target server (if DSN doesn’t exist then create one by opening ODBC Sources just like we created one for JSON API source (see the previous section about creating DSN).
- Enter your userid , password and Schema name and click Connect to see tables
- Select Table name to and click OK import definition.
Create Source to Target Mapping in Informatica (Import JSON to SQL Server)
Once you have imported source and target table definition, we can create mapping and transformation to load data from JSON to SQL Table.
- First open Mapping Designer (Click [D] icon)
- Drag JSON Source from sources folder
- Drag SQL Table from Targets folder
- Map desired columns from Source to target
-
For certain columns you may have to do datatype conversion. For example to convert OrderDate form nstring to DataTime you have to use Expression Transform like below and map it to target. In below example, our JSON has date format (e.g. 2018-01-31 12:00:00 AM ). To import this to DateTime field in SQL server we need to convert it using TO_DATE function. Use double quotes around T to make this format working.
TO_DATE(OrderDate,'YYYY-MM-DD H12:MI:SS AM') --For ISO use below way TO_DATE(OrderDate,'YYYY-MM-DD"T"HH24:MI:SS')
- Once you done with mapping save your mapping and name it (i.e. m_Api_To_SQL)
- Now lets move to next section to create workflow.
Create Workflow and Session in Informatica
Now the final step is to create a new workflow. Perform following steps to create workflow which with a session task to import JSON data into SQL table.
- Open workflow designer by click [W] icon.
-
Launch new workflow creation wizard by click Workflow top menu > Wizard
name your workflow (e.g. wf_Api_Tp_Sql_Table_Import) - Finish the wizard and double-click the Session to edit some default properties.
- First change Error settings so we fail session on error (By default its always green)
- Select JSON connection for Source
- Change default Source query if needed. You can pass parameters to this query to make it dynamic.
- Select Target connection of SQL Target Table
- Save workflow
- That’s it. We ready to run our first workflow to load JSON data to SQL.
Execute Workflow and Validate Log in Informatica
Now once you are done with your workflow, execute it to see the log.
POST data to Google Ads in Informatica
There will be a time when you like to send Source data to REST API or SOAP Web Service. You can use below Query for example. For detailed explanation on how to POST data in Informatica check this article.
Video Tutorial – How to POST data to REST API in Informatica
Here is detailed step by step video on REST API POST in informatica PowerCenter
Keywords
how to import Google Ads in informatica | how to read Google Ads data in informatica powercenter | how to test json from informatica | how to use Google Ads data as source in informatica power center | how to connect Google Ads in informatica 10 | informatica how to import data from Google Ads | informatica jtx to import Google Ads (use of java transformation) | informatica plugin for restful api using json | informatica power center and Google Ads support | informatica read Google Ads | informatica rest api | informatica Google Ads connector | json parser import informatica
Advanced topics
Create Custom Stored Procedure in ZappySys Driver
You can create procedures to encapsulate custom logic and then only pass handful parameters rather than long SQL to execute your API call.
Steps to create Custom Stored Procedure in ZappySys Driver. You can insert Placeholders anywhere inside Procedure Body. Read more about placeholders here
-
Go to Custom Objects Tab and Click on Add button and Select Add Procedure:
-
Enter the desired Procedure name and click on OK:
-
Select the created Stored Procedure and write the your desired stored procedure and Save it and it will create the custom stored procedure in the ZappySys Driver:
Here is an example stored procedure for ZappySys Driver. You can insert Placeholders anywhere inside Procedure Body. Read more about placeholders here
CREATE PROCEDURE [usp_get_orders] @fromdate = '<<yyyy-MM-dd,FUN_TODAY>>' AS SELECT * FROM Orders where OrderDate >= '<@fromdate>';
-
That's it now go to Preview Tab and Execute your Stored Procedure using Exec Command. In this example it will extract the orders from the date 1996-01-01:
Exec usp_get_orders '1996-01-01';
-
Let's generate the SQL Server Query Code to make the API call using stored procedure. Go to Code Generator Tab, select language as SQL Server and click on Generate button the generate the code.
As we already created the linked server for this Data Source, in that you just need to copy the Select Query and need to use the linked server name which we have apply on the place of [MY_API_SERVICE] placeholder.
SELECT * FROM OPENQUERY([LINKED_SERVER_TO_GOOGLE_ADS_IN_DATA_GATEWAY], 'EXEC usp_get_orders @fromdate=''1996-07-30''')
-
Now go to SQL served and execute that query and it will make the API call using stored procedure and provide you the response.
Create Custom Virtual Table in ZappySys Driver
ZappySys API Drivers support flexible Query language so you can override Default Properties you configured on Data Source such as URL, Body. This way you don't have to create multiple Data Sources if you like to read data from multiple EndPoints. However not every application support supplying custom SQL to driver so you can only select Table from list returned from driver.
If you're dealing with Microsoft Access and need to import data from an SQL query, it's important to note that Access doesn't allow direct import of SQL queries. Instead, you can create custom objects (Virtual Tables) to handle the import process.
Many applications like MS Access, Informatica Designer wont give you option to specify custom SQL when you import Objects. In such case Virtual Table is very useful. You can create many Virtual Tables on the same Data Source (e.g. If you have 50 URLs with slight variations you can create virtual tables with just URL as Parameter setting.
-
Go to Custom Objects Tab and Click on Add button and Select Add Table:
-
Enter the desired Table name and click on OK:
-
And it will open the New Query Window Click on Cancel to close that window and go to Custom Objects Tab.
-
Select the created table, Select Text Type AS SQL and write the your desired SQL Query and Save it and it will create the custom table in the ZappySys Driver:
Here is an example SQL query for ZappySys Driver. You can insert Placeholders also. Read more about placeholders here
SELECT "ShipCountry", "OrderID", "CustomerID", "EmployeeID", "OrderDate", "RequiredDate", "ShippedDate", "ShipVia", "Freight", "ShipName", "ShipAddress", "ShipCity", "ShipRegion", "ShipPostalCode" FROM "Orders" Where "ShipCountry"='USA'
-
That's it now go to Preview Tab and Execute your custom virtual table query. In this example it will extract the orders for the USA Shipping Country only:
SELECT * FROM "vt__usa_orders_only"
-
Let's generate the SQL Server Query Code to make the API call using stored procedure. Go to Code Generator Tab, select language as SQL Server and click on Generate button the generate the code.
As we already created the linked server for this Data Source, in that you just need to copy the Select Query and need to use the linked server name which we have apply on the place of [MY_API_SERVICE] placeholder.
SELECT * FROM OPENQUERY([LINKED_SERVER_TO_GOOGLE_ADS_IN_DATA_GATEWAY], 'EXEC [usp_get_orders] ''1996-01-01''')
-
Now go to SQL served and execute that query and it will make the API call using stored procedure and provide you the response.
Actions supported by Google Ads Connector
Google Ads Connector support following actions for REST API integration. If some actions are not listed below then you can easily edit Connector file and enhance out of the box functionality.Parameter | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Filter |
|
||||||||||
Enter Query (i.e. GAQL sql) |
|
Parameter | Description |
---|---|
Resource |
|
Parameter | Description |
---|---|
Resource |
|
Parameter | Description |
---|---|
Resource |
|
Parameter | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Filter |
|
||||||||||
Resource |
|
||||||||||
Attributes (Leave blank to select all) |
|
||||||||||
Segments (Group By) |
|
||||||||||
Metrics (Aggregate Fields) |
|
||||||||||
Where Clause |
|
||||||||||
OrderBy Clause |
|
||||||||||
Limit Clause (i.e. Max Rows) - Blank means all rows |
|
Parameter | Description | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Url |
|
||||||||||||||||||||||||||
Body |
|
||||||||||||||||||||||||||
IsMultiPart |
|
||||||||||||||||||||||||||
Filter |
|
||||||||||||||||||||||||||
Headers |
|
Parameter | Description |
---|---|
Url |
|
IsMultiPart |
|
Filter |
|
Headers |
|
Google Ads Connector Examples for Informatica Connection
This page offers a collection of SQL examples designed for seamless integration with the ZappySys API ODBC Driver under ODBC Data Source (36/64) or ZappySys Data Gateway, enhancing your ability to connect and interact with Prebuilt Connectors effectively.
Get Campaigns [ Read more... ]
Get all Campaigns for Google Ads account
SELECT * FROM get_campaigns
Get Customers [ Read more... ]
Get all customers you can query in your account
SELECT * FROM get_customers
Get campaign performance report by date [ Read more... ]
Get campaign performance data, group by date and campaign
SELECT * FROM get_report_campaign_performance_by_date WITH(ReportStartDate='monthstart', ReportEndDate='today-1d')
Get campaign performance report by month [ Read more... ]
Get campaign performance data, group by year, month and campaign
SELECT * FROM get_report_campaign_performance_by_month WITH(ReportStartDate='monthstart', ReportEndDate='today-1d')
Get keywords information (all campaigns / ad groups) [ Read more... ]
Get keywords for all campaigns and all ad groups (criterion_id is basically keyword_id)
select * from get_campaign_keywords
Get resource data (e.g. ad_group, ad_group_ad, keyword_view [ Read more... ]
Get data for any resource
SELECT * FROM get_resource_data
WITH (
Resource='Campaign'
--//Optional Parameters
--, Attributes='' --Keep blank to output all attributes
--OR--
--, Attributes='campaign.id~campaign.name~campaign.end_date'
--, Metrics='metrics.clicks~metrics.impressions'
--, Segments='segments.year~segments.month'
--//must supply where clause if certain segments used (e.g. date, year, month)
--, Where='segments.date between ''<<yearstart,FUN_TO_DATE>>'' AND ''<<today-1d,FUN_TO_DATE>>'' '
--, OrderBy='segments.year DESC, segments.month ASC'
)
/*
--OR-- Simple Mode (Query by Resource Name in FROM clause).
Step-1: Findout all resource you can query using
select * from get_resources
Step-2: Use resource name like below (in FROM)
Example resources (If data is missing it may throw error)
select * from ad_group
select * from ad_group_ad
select * from ad_group_ad_asset_combination_view
select * from ad_group_ad_asset_view
select * from ad_group_asset
select * from ad_group_audience_view
select * from ad_schedule_view
select * from age_range_view
select * from android_privacy_shared_key_google_ad_group
select * from android_privacy_shared_key_google_campaign
select * from android_privacy_shared_key_google_network_type
select * from asset
select * from asset_field_type_view
select * from asset_group
select * from asset_group_asset
select * from asset_group_product_group_view
select * from asset_group_top_combination_view
select * from asset_set_asset
select * from asset_set_type_view
select * from bidding_strategy
select * from campaign
select * from campaign_aggregate_asset_view
select * from campaign_asset
select * from campaign_audience_view
select * from campaign_budget
select * from campaign_group
select * from campaign_search_term_insight
select * from channel_aggregate_asset_view
select * from click_view
select * from content_criterion_view
select * from conversion_action
select * from customer
select * from customer_asset
select * from customer_search_term_insight
select * from detail_placement_view
select * from display_keyword_view
select * from distance_view
select * from dynamic_search_ads_search_term_view
select * from expanded_landing_page_view
select * from gender_view
select * from geographic_view
select * from group_placement_view
select * from hotel_group_view
select * from hotel_performance_view
select * from hotel_reconciliation
select * from income_range_view
select * from keyword_view
select * from landing_page_view
select * from location_view
select * from managed_placement_view
select * from paid_organic_search_term_view
select * from parental_status_view
select * from per_store_view
select * from performance_max_placement_view
select * from product_group_view
select * from search_term_view
select * from shared_set
select * from shopping_performance_view
select * from shopping_product
select * from smart_campaign_search_term_view
select * from topic_view
select * from travel_activity_group_view
select * from travel_activity_performance_view
select * from user_location_view
select * from video
select * from webpage_view
*/
Query Google Ads data using GAQL (Google Ads Query Language) [ Read more... ]
Get Google Ads report data using GAQL (Google Ads Query Language) SQL query. Use Query builder from this link to select fields, segments, and metrics https://developers.google.com/google-ads/api/fields/v18/overview_query_builder (Click on Resource type you like to query) for SELECT, FROM and ORDER BY
--Use Query Builder here https://developers.google.com/google-ads/api/fields/v18/overview_query_builder
--Paste Generated query in Query='here'
SELECT
[campaign.id] as id,
[campaign.name] as name,
[metrics.impressions] as impressions,
[metrics.clicks] as clicks,
[metrics.costMicros] / 1000000 as cost --//API returns Unit in Micro so to get actual value divide by 1000000
FROM get_query_result
WITH(
Filter='$.results[*]'
, Query='SELECT campaign.id, campaign.name, metrics.impressions, metrics.clicks, metrics.cost_micros
FROM campaign
WHERE campaign.status = ''ENABLED''
AND metrics.impressions > 10
ORDER BY campaign.id
--LIMIT 1000
'
--Set different Customer Id here if not supplied in connection settings
--, CustomerId='1112223333'
)
Query Google Ads data (Simple Mode) - using #DirectSQL prefix [ Read more... ]
Get Google Ads report data using GAQL (Google Ads Query Language) - SQL query using simple mode. This example passes GAQL query to get_query_result endpoint with specifying endpoint details. You must prefix query with special tag #DirectSQL
#DirectSQL
--Use Query Builder here https://developers.google.com/google-ads/api/fields/v18/overview_query_builder
--Paste Generated query below
SELECT campaign.id, campaign.name, metrics.impressions, metrics.clicks, metrics.cost_micros
FROM campaign
--WHERE campaign.status = 'ENABLED'
--ORDER BY campaign.id
--LIMIT 1000
Query Google Ads Campaign Performance Data (Metrics / Segments) - using #DirectSQL prefix [ Read more... ]
Get Google Ads report data using GAQL (Google Ads Query Language) group by Date and Campaign. You must prefix query with special tag #DirectSQL
#DirectSQL
--Use Query Builder here https://developers.google.com/google-ads/api/fields/v18/overview_query_builder
--Paste Generated query below
SELECT
segments.date
, campaign.id
, campaign.name
, metrics.all_conversions
, metrics.average_cpc
, metrics.average_cost
, metrics.average_cpv
, metrics.average_cpm
, metrics.average_cpe
, metrics.average_impression_frequency_per_user
, metrics.average_page_views
, metrics.bounce_rate
, metrics.clicks
, metrics.conversions
, metrics.content_impression_share
, metrics.content_budget_lost_impression_share
, metrics.cost_micros
, metrics.cost_per_all_conversions
, metrics.cost_per_conversion
, metrics.ctr
, metrics.engagement_rate
, metrics.engagements
--, metrics.general_invalid_click_rate
--, metrics.general_invalid_clicks
, metrics.impressions
, metrics.interaction_rate
, metrics.interactions
, metrics.invalid_clicks
, metrics.search_absolute_top_impression_share
, metrics.search_budget_lost_absolute_top_impression_share
, metrics.search_budget_lost_impression_share
, metrics.search_budget_lost_top_impression_share
, metrics.search_click_share
, metrics.search_impression_share
, metrics.video_view_rate
, metrics.video_quartile_p75_rate
, metrics.video_quartile_p50_rate
, metrics.video_quartile_p25_rate
, metrics.video_quartile_p100_rate
, metrics.video_views
, metrics.view_through_conversions
, metrics.unique_users
, metrics.top_impression_percentage
, metrics.search_rank_lost_top_impression_share
, metrics.search_rank_lost_impression_share
, metrics.search_rank_lost_absolute_top_impression_share
, metrics.search_top_impression_share
, metrics.search_exact_match_impression_share
, metrics.absolute_top_impression_percentage
, metrics.active_view_cpm
, metrics.active_view_ctr
, metrics.active_view_impressions
FROM campaign
WHERE segments.date BETWEEN '<<monthstart,FUN_TO_DATE>>' and '<<today-1d,FUN_TO_DATE>>'
--WHERE segments.date BETWEEN '2025-01-25' and '2025-02-25'
--AND WHERE campaign.status = 'ENABLED'
--ORDER BY segments.date,campaign.id
--LIMIT 1000
Conclusion
In this article we showed you how to connect to Google Ads in Informatica and integrate data without any coding, saving you time and effort. We encourage you to download Google Ads Connector for Informatica and see how easy it is to use it for yourself or your team.
If you have any questions, feel free to contact ZappySys support team. You can also open a live chat immediately by clicking on the chat icon below.
Download Google Ads Connector for Informatica Documentation
More integrations
Other connectors for Informatica
Other application integration scenarios for Google Ads
How to connect Google Ads in Informatica?
How to get Google Ads data in Informatica?
How to read Google Ads data in Informatica?
How to load Google Ads data in Informatica?
How to import Google Ads data in Informatica?
How to pull Google Ads data in Informatica?
How to push data to Google Ads in Informatica?
How to write data to Google Ads in Informatica?
How to POST data to Google Ads in Informatica?
Call Google Ads API in Informatica
Consume Google Ads API in Informatica
Google Ads Informatica Automate
Google Ads Informatica Integration
Integration Google Ads in Informatica
Consume real-time Google Ads data in Informatica
Consume real-time Google Ads API data in Informatica
Google Ads ODBC Driver | ODBC Driver for Google Ads | ODBC Google Ads Driver | SSIS Google Ads Source | SSIS Google Ads Destination
Connect Google Ads in Informatica
Load Google Ads in Informatica
Load Google Ads data in Informatica
Read Google Ads data in Informatica
Google Ads API Call in Informatica