Posts under category google-ads-api

Hi I am trying to write a script that will extract the data from Google Ads Report (Call Details) or 'call_metrics_call_details_report' to a spreadsheet automatically. I have been able to extract all the details successfully - except for the caller phone number. There also does not seem to be a google attribute for this. Can anybody help? Thank you

function importCallDetails() {   var accountId = AdWordsApp.currentAccount().getCustomerId();   var startDate = "INSERT_START_DATE_HERE";   var endDate = "INSERT_END_DATE_HERE";   var query = "SELECT CallStartTime, CallDuration, CallerCountryCallingCode, CampaignName,     CampaignId " + "FROM CALL_METRICS_CALL_DETAILS_REPORT";   var report = AdsApp.report(query);   var data = report.rows();   var spreadsheetUrl = 'https://docs.google.com/spreadsheets/*********/';   var spreadsheet = SpreadsheetApp.openByUrl(spreadsheetUrl);   var ss = spreadsheet.getSheetByName('PAGE1');   ss.clearContents();   report.exportToSheet(ss); }   function main() {   importCallDetails(); } 

I wanna get out campaigns reports using Google Rest API and it does'nt work in Google ads Apps script.

My code:

function main() {    const API_VERSION = "12"; const CUSTOMER_ID = "***"; //contais real custommer ID const DEVELOPER_TOKEN = "***"; //contais real developper ID const MANAGER_CUSTOMER_ID = "***"; //contais real manager ID const OAUTH2_ACCESS_TOKEN = ""; //contais real ACCES TOKEN const data = {   "pageSize": 10000,   "query": "SELECT ad_group_criterion.keyword.text, ad_group_criterion.status FROM ad_group_criterion WHERE ad_group_criterion.type = 'KEYWORD' AND ad_group_criterion.status = 'ENABLED'" }; const url = `https://googleads.googleapis.com/v${API_VERSION}/customers/${CUSTOMER_ID}/googleAds:search`; const options = {   method: "POST",   headers: {     "Content-Type": "application/json",     "developer-token": DEVELOPER_TOKEN,     "login-customer-id": MANAGER_CUSTOMER_ID,     "Authorization": `Bearer ${OAUTH2_ACCESS_TOKEN}`   },   body:  JSON.stringify(data),    "muteHttpExceptions": true }; Logger.log(UrlFetchApp.fetch(url, options)); } 

Result error: { "error": { "code": 400, "message": "Request contains an invalid argument.", "status": "INVALID_ARGUMENT", "details": [ { "@type": "type.googleapis.com/google.ads.googleads.v12.errors.GoogleAdsFailure", "errors": [ { "errorCode": { "queryError": "UNEXPECTED_END_OF_QUERY" }, "message": "Error in query: unexpected end of query." } ], "requestId": "zKBR9-dJoG9NWAx3iJea2g" } ] } }

But query is valid https://developers.google.com/google-ads/api/fields/v11/query_validator enter image description here

Could you plese help?

Thanks

I wanna get out campaigns reports using Google Rest API and it does'nt work. My code and result is above.

I am trying to build a report that shows metrics such as clicks, impressions and costs per targeted location from Google Ads.

I compare these numbers with Campaigns stats and it does not match. I got lower number from Geo stats actually. On the other hand, in google Ads application, the numbers are the same.

When I compare AdGrup stats with Campaing stats, it is matching for 100 %.

Thanks

I want to understand why there is this discrepancy and how can I solve it.

I'm using Google Analytics to add data to the corresponding and connected Google Ads campaign, visible in the Googla Ads backend.

Connecting Analytics UA with Google Ads worked fine, but the user data delivered by GA4 does not appear in Google Ads.

I connected the new GA4 account with the matching Google Ads account.

The data, that should appear as columns in the Ads campaign data, can be found in the settings for the columns. Go to "Campaigns", then "Columns" - Modify columns - Google Analytics.

Here should appear "% Engaged sessions (GA4)", "Events/session (GA4)", "Avg. session duration (seconds) (GA4)".

In some cases it does, but mostly not. (2 out of 6 it works)

I tried to find differences or similarities to get to the bottom of the problem. Although some of the installations are using GTM and some are not the ones with the problem do not correlate to the one with or without GTM.

Settings and connection in Google Ads and GA4 should be similar as far as I can see. GA4 accounts are listed under the "tools and settings" - "setup" - "linked accounts" in Google Ads.

In "Google Analytics (GA4) & Firebase" - "Manage & Link" I can see a difference in the columns. The accounts with the correct data have the entry "Linked: App and web metrics activated" in Status and an extra column "Apps and web metrics", where it says "Deactivate".

I'm trying to finish my analytics setup and I've got a bit confused what is the best way forward. The end goal is to have tracking setup that enables me to optimize my Google and Facebook campaigns towards approved users instead of just signed up users. Our product has the following funnel:

  1. User visits our website
  2. He signs up for our product using website lead form (at this moment I have user's email, name, phone number etc.)
  3. Based on our evaluation (that can take hours or days) the user is approved or disapproved in our CRM

I want to provide the advertising systems (mainly Google Ads and Facebook Ads) with an information when the user was approved with all the required ids so the system can trace the event back to the ad the user clicked.

I have the following analytical stack that I am working with:

  • Website GTM container
  • Server GTM container (GA4+ UA clients, GA4 + UA + FCAPI tags)
  • Facebook Conversion API implemented in sGTM

What would be the best way in your opinion to implement the tracking of the event that is fired from our CRM when user is approved? I was thinking about using Measurement Protocol to send the event to sGTM/GA4 or Enhanced conversions for leads for Google Ads but neither solutions seems to fit 100 % to my scenario. What would you recommend? Thank you for any inputs.