/ Blog / Mastering Google Ads Integration with Azure Synapse / Data Factory: A Practical Step-by-Step Tutorial

Mastering Google Ads Integration with Azure Synapse / Data Factory: A Practical Step-by-Step Tutorial

Master Google Ads Integration: Quick & Easy Setup in Azure Synapse / Data Factory

Want to Build AI agents that can reason, plan, and execute autonomously?

Modern marketing teams need to track digital ad performance quickly and accurately. If you are running Google Ads campaigns, integrating your data into Azure Synapse / Data Factory ensures you can analyze impressions, clicks, conversions, and spend alongside your other enterprise datasets. 

In this step-by-step guide, we’ll walk you through: 

  • Setting up a Google Ads Manager account 
  • Enabling API access and getting a Developer Token 
  • Creating Google Cloud credentials 
  • Generating OAuth tokens (Client ID, Client Secret, Refresh Token) 
  • Configuring the Linked Service in Azure Synapse / Data Factory 
  • Testing the connection with a pipeline 

Discover how to build modular AI agents using OpenAI’s Agents SDK

Why Connect Google Ads with Azure Synapse / Data Factory? 

By linking Google Ads data with Synapse or Data Factory, you can: 

  • Automate the flow of paid search metrics into your data warehouse. 
  • Build Power BI dashboards that provide real-time marketing performance insights. 
  • Combine advertising spend data with sales, CRM, or other internal systems. 
  • Eliminate manual exports and reduce reporting delays. 

Pre-requisites: Create a Google Ads Manager Account (Optional) 

A manager account is a Google Ads account that lets you easily view and manage multiple Google Ads accounts (including other manager accounts) from a single account.  

If you don’t already have one: 

  1. Visit Google Ads Manager Accounts. 
  2. Sign in with the email you want to use. 
  3. Choose how you plan to use the account, either as an account to manage your own Google Ads accounts, or to manage other people’s accounts. 
  4. Choose your account name, usage type, country, time zone, and currency. 
  5. After creation, note your Manager Account ID (10-digit number). 

Explore how Deep Research enhances ChatGPT’s reasoning and workflows

Data Factory/Azure Synapse - Creating a Google Ads Manager Account

Step 1: Link Client Ads Accounts 

To pull campaign data into Azure Synapse / Data Factory, you must link your client account to the manager account: 

  • In your Manager Account, click your profile logo to switch to your Client Account. 
  • Note the 10-digit Client Account ID (e.g., 123-456-7890). 
  • Go back to your Manager Account and select Link Existing Accounts. 

Data Factory/ Azure Synapse - Link Existing Accounts in Manager Account

  • Add the Client Account ID → Send invitation. 
  • Accept the request in the Client Account’s email inbox.

Learn the evolution of OpenAI models from GPT‑1 to 2025

Step 2: Get a Developer Token 

The Developer Token allows Synapse to call the Google Ads API. 

  • Go to Google Ads API Center. Sign in to your Google Ads manager account if prompted. 
  • Fill in the access form and accept the terms. 
  • Ensure that your information is correct and your company’s website URL is functioning. If the website is not live, Google might not be able to process your application and reject it. 
  • Ensure that the API contact email you provide leads to a regularly monitored inbox. Google’s API compliance team might reach out to this email address during the review process for clarifications. If you can’t be reached, Google might not continue with your application. 
  • Your developer token now has Test Account Access level and you can start making API calls against test accounts (Optional). 
  • Apply for basic API access (Google usually responds in ~3 working days). 

Data Factory/ Azure Synapse: Applying for basic API Access in Google Ads

  • While you wait for approval you can continue with the following steps, note the developer token value as you will require it when making your first API call. 

Step 3: Create Google Cloud Credentials 

  • Visit Google Cloud Console. 
  • Create a new project under Menu > IAM & Admin > Create Project. 
  • Enable the Google Ads API in your project. 
  • Open the API Library in the Google API Console. If prompted, select your project or create a new one. The API Library lists all available APIs, grouped by product family and popularity. 
  • Select the Google Ads API, then click the Enable button. 

Discover the best data science events to learn, network, and grow in 2025

Data Factory - Google Ads API

Azure Synapse/ Data Factory - Google Ads API

Step 4: Configure OAuth Consent Screen 

  • In the left menu of Google Cloud, go to APIs & Services → OAuth consent screen. 
  • Click on get started.

Azure Synapse/ Data Factory - Configure OAuth Consent Screen

  • Select External user type. 
  • Enter App name, support email, and developer contact info. 
  • Agree and Create. 

Step 5: Create OAuth Credentials (Client ID & Secret) 

  • Go to APIs & Services → Credentials. 
  • Click Create Credentials → OAuth Client ID. 
  • Choose Web Application 

Azure Synapse/ Data Factory - Create OAuth Client ID

Azure Synapse/ Data factory - Redirect URIs

  • Click Create. 
  • Save and download the JSON file containing your Client ID and Client Secret. 

Azure Synapse/ Data Factory - OAuth Client Created

  • Go to Audience Tab and publish the app. 

Azure Synapse/ Data Factory - Publish App Google Ads

Step 6: Get Authorization code 

  • Enter the following URL into your browser (replace CLIENT_ID): 

https://accounts.google.com/o/oauth2/auth client_id=$CLIENT_ID&redirect_uri=http://localhost&response_type=code&scope=https://www.googleapis.com/auth/adwords&access_type=offline 

  • You might get a dialogue box of “google hasn’t verified this app”, just click Advance and go to the site. 

Azure Synapse/Data factory - Google Hasn't Verified This App

  • Sign in with your email used in the process. 

Azure Synapse/ Data Factory - Sign in with google

  • Copy the Authorization Code from the redirect URL. 

Azure Synapse/ Data Factory - Redirect URL Authorization Code

  • Exchange the code for a Refresh Token using Postman or URL

Explore top AI conferences shaping innovation across the USA in 2025

Step 7: Use Authorization Code to get the Refresh Token 

Since the authorization code expires quickly, use Postman (or curl) to get a Refresh Token. 

Request URL: 

  • https://oauth2.googleapis.com/token 

Request Body (x-www-form-urlencoded): 

  • code=AUTHORIZATION_CODE 
  • client_id=CLIENT_ID 
  • client_secret=CLIENT_SECRET 
  • redirect_uri=http://localhost 
  • grant_type=authorization_code 

Azure Synapse/ Data Factory - Request Body

Response Example: 

Azure Synapse/ Data Factory - Response Example

Save the Refresh Token. This will be used by Synapse / Data Factory. 

If  you get the following error, it is most likely that the authorization code expired therefore you need to repeat the step 6 and then quickly jump to step 9! 

Azure Synapse/ Data factory - Save the response token

Shell Route (alternative) 

The command would look like this: 

AUTHORIZATION_CODE=4/0Be…BcpYX &&
CLIENT_ID=467…m134.apps.googleusercontent.com &&
CLIENT_SECRET=TXA…zgB &&
curl \
–request POST \
–data  “code=${AUTHORIZATION_CODE}&client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}&redirect_uri=http://localhost&grant_type=authorization_code” https://oauth2.googleapis.com/token

Step 8: Configure Google Ads Linked Service in Synapse / Data Factory 

Populate the linked service fields with: 

  • API Version: v20 or higher 
  • Developer Token 
  • Manager Account ID 
  • Client Account ID 
  • Client ID 
  • Client Secret 
  • Refresh Token 

Azure Synapse/ Data Factory - Configure google ads linked service

Azure Synapse/ Data Factory - New Linked Service Google Ads

Azure Synapse/ Data Factory - Edit linked service Google Ads

Step 9: Test the Connection 

  • In Synapse, add a Lookup Activity to your pipeline. 
  • Create a dataset using the Google Ads linked service.

Azure Synapse/ Data Factory - Creating a dataset using Google Ads linked service 

  • Search for google ads and hit continue.

Azure Synapse/ Data Factory - Creating a dataset using Google Ads linked service

  • Name accordingly and select newly created linked service from the dropdown.

Azure Synapse/ Data Factory - Creating a dataset using Google Ads linked service

  • Run a test query, for example: 

 

Azure Synapse/ Data Factory - Creating a dataset using Google Ads linked service

  • If successful, your pipeline can now pull Google Ads data into Synapse. 
  • If you see the following error, check that your Developer Token has Basic Access enabled. 

Azure Synapse/ Data Factory - Creating a dataset using Google Ads linked service

Final Thoughts 

Integrating Google Ads with Azure Synapse / Data Factory is a powerful way to automate reporting. Once connected, you can: 

  • Track campaign ROI in near real time. 
  • Build Power BI dashboards for marketing and leadership. 
  • Combine advertising performance with sales and customer data for deeper insights. 

With this setup, your marketing team can move away from manual reporting and focus on optimizing campaigns that drive measurable business outcomes. 

Ready to build the next generation of agentic AI?
Explore our Large Language Models Bootcamp and Agentic AI Bootcamp for hands-on learning and expert guidance.

 

Subscribe to our newsletter

Monthly curated AI content, Data Science Dojo updates, and more.

Sign up to get the latest on events and webinars

Data Science Dojo | data science for everyone

Discover more from Data Science Dojo

Subscribe to get the latest updates on AI, Data Science, LLMs, and Machine Learning.