How to Import Google Campaign Keywords Data in Salesforce?
Author
September 14, 2015
Google AdWords provides you with a unique ID, called a “GCLID,” for every click that comes to your website from an AdWords ad. By querying you’ll be able to see which keywords (Search String) are contributing not just to new lead submissions, but, more importantly, to actual sales.
How to Retrieve Google Adword Keywords in Salesforce
Step 1:
You need to have an AdWords manager account to apply for access to the API. If you don’t already have a manager account, you will need to create one.
For Create a new Manager Account follow the link.
https://www.google.com/adwords/myclientcenter/
Step 2:
Adwords API access:
For Adwords API access we need to submit the details after logged in to your manager account:
Go to Gear Icon Account Settings- Adwords API Center.
Note:
1) Make sure your information is correct and your company’s website URL is functioning. If the website is not a live page, google will not be able to process your application.
2) Google will initially contact you within two business days of the date you submitted your application. In the meantime, you can try out the API with Test Account.
Step 3:
After completing Step 2, a link to a follow-up application form will be sent from adwordsapi-tokens@google.com to the email address listed in the AdWords API Centre. Please complete this follow-up form to continue your application. We need to take approve of our developer token for interacting with google system.
Token Review Team
Your assigned developer token will be activated once your application for API access is approved. Your token will be available through your AdWords API Centre accessible through the Account settings menu for the manager account from which you applied. You’ll be able to access the API by including it in your request headers when interacting with google system.
Note: You can use the Production developer token against a Test account even when the production developer token is pending approval. While make Adwords API calls.
What is Test Account?
AdWords test accounts allow developers to execute AdWords API requests against the production environment for development and testing purposes.
Note: You cannot link test MCC or Adwords accounts to production MCC accounts, or vice versa.
Prerequisites for Adwords API Calls
For make Calls against the AdWords API require two pieces of information
A) An approved Developer Token if it is Production account, for Test account no need of approved one.
B) Credentials that allow access to the targeted account (OAuth2.0).
Developer Token: It is automatically generated for you when you create account. For access it.
Go to Gear Icon Account Settings Adwords API Center.
Credentials: Each request to the AdWords API must be authorized to make changes or retrieve data for an AdWords account.
To use OAuth 2.0 to authorize the AdWords API, We need to exchange Token for authentication for this we need to send request to https://accounts.google.com/o/oauth2/token
Method –> Post.
Here:
Redirect_uri =https://accounts.google.com/o/oauth2/token
grant_type=authorization_code
For Authorization Code
Paste the following URL in your browser after fill the client_id.
You will then see a screen to grant your application access to your AdWords data:
After you accept the request, you will get an authorization code that can be exchanged for an access token.
For Client Id and Secret
You must first create a client identifier and a client secret.
Step 1: Register your application https://console.developers.google.com/ and create a Client Id. Then google will provide you Client Id and Client Secret. Which are useful for authentication.
For Client Id we need to create Project
Step 2: From top left corner click on Select Project –> Create Project:
Enter the Project Name then click on Create. You can also observe Project Id here.
After Successful creation it will open then
Go to API & Auth Credentials.
Step 3: It prompt window choose OAuth 2.0 Client Id.
Step 4: Make sure all of the required fields are filled and saved for the Consent Screen. Choose any name for Product.
Step 5: Select type of Application and give Redirect Url as:
https://accounts.google.com/o/oauth2/token
Client ID and Client secret will be created and displayed.
Use these details for make request. If you’ve made a proper request, Google will return your OAuth2 token. The access token is what you need when sending requests to AdWords API services
Example: Report download.
Pull keyword data into Salesforce using the gclid (Google Click Id)
For pull keyword data we need to go for Report download API and report type is CLICK_PERFORMANCE_REPORT.
Use this API for get Keyword information:
https://adwords.google.com/api/adwords/reportdownload/v201506
Method: POST
Request headers:
Authorization: Bearer YOUR_ACCESS_TOKEN (Which is generated in Earlier Request)
DeveloperToken: YOUR_Developer_TOKEN(22 character)
clientCusomerId: xxx xxx xxxx
Sample Request Body is:
__rdquery=SELECT+CriteriaId+FROM+CLICK_PERFORMANCE_REPORT+WHERE GclId=1234+DURING+20150901,20150901&__fmt=CSV
“__rdquery
“: contains the AWQL query string.
“__fmt
“: defines the report download format either CSV OR XM
Recent Posts
-
Leveraging AI to Enhance Sales Effectiveness13 Mar 2025 Use-case
-
Revolutionizing Manufacturing with AI: Predictive Maintenance, Supply Chain Optimization, and More11 Mar 2025 E-Book
-
NetSuite for Manufacturing: Streamlining Operations and Solving Key Challenges07 Mar 2025 Blog
-
How to Build Your First Agent in Salesforce Agentforce24 Feb 2025 Blog
-
ERP vs Salesforce Revenue Cloud: Which One is Right for Your Business?24 Feb 2025 E-Book
-
Revolutionizing Manufacturing with Salesforce: A Playbook for Efficiency & Growth18 Feb 2025 E-Book
-
Salesforce 2025 Game-Changing Trends You Need to Know28 Jan 2025 Blog
-
Agentforce 2.0: Everything You Need to Know About the Latest Update22 Jan 2025 Blog
-
The Ultimate Guide to NetSuite Development: Tools and Techniques10 Jan 2025 Blog
-
How Salesforce Nonprofit Cloud Transforms Fundraising Strategies10 Jan 2025 Blog
-
The Impact of Salesforce Development Partners on Small and Medium Businesses08 Jan 2025 Blog
-
Key Questions to Ask When Hiring a NetSuite Development Partner08 Jan 2025 Blog
-
Salesforce Agentforce Demystified: Your Essential Guide08 Jan 2025 Blog
-
Salesforce and NetSuite Integration: Driving Business Efficiency with Precision06 Jan 2025 Blog
-
Everest Group has positioned Mirketa as an Aspirant in the report24 Dec 2024 Press Release
-
Salesforce Einstein20 Dec 2024 E-Book
-
Order to Cash Cycle with NetSuite20 Dec 2024 E-Book
-
Empower Your Marketing Strategy with Salesforce Marketing Cloud's Automation Studio Activities13 Dec 2024 Blog
-
Salesforce CPQ for Subscription-based Businesses10 Dec 2024 Blog
-
Unleashing the Magic of Einstein Prediction Builder10 Dec 2024 Blog