How to get country code name for campaign geo metrices?

140 views
Skip to first unread message

Arun Kumar

unread,
Nov 26, 2024, 5:17:11 AM11/26/24
to Google Ads API and AdWords API Forum
Hi, 

I'm collecting campaign geo metrices using geographic_view resource, and from the resource name field I'm picking the country code as campaing geo metrices.

e.g `customers/1260650121/geographicViews/2192~LOCATION_OF_PRESENCE`  From this picking  2192  as country_code for the matrices data. But by this code no data return from the geo_target_constant resource.

Can you please help from where i can get data for this location.

Or is there any other resource by which i can directly get the country name with campaign geo metrices data?


Google Ads API Forum Advisor

unread,
Nov 26, 2024, 10:34:01 AM11/26/24
to arunkum...@gmail.com, adwor...@googlegroups.com
Hi,

Thank you for reaching out to the Google Ads API support team.

Kindly note that some countries/territories are not targetable in Google Ads API, but may appear in reports based on the user's area of interest or physical location. Since "2192" is not available in the geotargeting table but present in your Geo Performance Report, it could be any of the countries/territories as specified here. Also, note that the ids that you are seeing are the ones found in the Google Ads country restrictions document. 
 
This message is in relation to case "ref:!00D1U01174p.!5004Q02vGm8U:ref" (ADR-00276826)

Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5



Arun Kumar

unread,
Nov 27, 2024, 2:16:00 AM11/27/24
to Google Ads API and AdWords API Forum
Thanks for the reply, Your answer resolved my query. 

Arun Kumar

unread,
Nov 29, 2024, 6:35:05 AM11/29/24
to Google Ads API and AdWords API Forum
While fetching data from geographic view, only getting a single entry for a campaign for a specific date, but while checking for the same data for that campaign channel in ad sense there are record present for few other countries with less or minor revenue compare to the major country revenue for which data exists in the geographic_view, How can i get the entire geo locations data records by a specifc campaign, for now I'm using below query 


SELECT
                campaign.id,
                campaign.name,
                customer.id,
                customer.descriptive_name,
                campaign.status,
                campaign.serving_status,
                campaign.primary_status,
                campaign.primary_status_reasons,
                metrics.average_cost,
                metrics.average_cpc,
                metrics.average_cpm,
                metrics.average_cpv,
                metrics.clicks,
                metrics.conversions,
                metrics.conversions_value,
                metrics.impressions,
                metrics.ctr,
                metrics.cost_per_conversion,
                metrics.cost_per_all_conversions,
                metrics.cost_micros,
                segments.date,
                geographic_view.location_type
                FROM geographic_view
                WHERE segments.date >= '2024-11-25' AND segments.date <= '2024-11-25'

Google Ads API Forum Advisor

unread,
Nov 29, 2024, 9:30:43 AM11/29/24
to arunkum...@gmail.com, adwor...@googlegroups.com

Hi,

Thank you for reaching out to the Google Ads API support team.

It seems you're receiving incomplete geographic data for your campaign, and you'd like to see data for additional countries as well. To help investigate the issue further, could you please provide the following:

  1. Complete API logs: This will help us see the exact request and response you're receiving when fetching the data. The logs will be request and response logs with request-id and request header generated at your end when fetching the data.
  2. Uncropped Google Ads UI screenshot: Please share the screenshot that shows the full geographic data for the campaign(s) in the Google Ads interface, as this will allow us to compare it with what the API is returning.

Once we have these, we can better identify the root cause of the issue.

Regarding the logs, if you are using a client library and haven't enabled the logging yet, I would request that you enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag.

You can send the details via Reply privately to the author option or direct private reply to this email. 

This message is in relation to case "ref:!00D1U01174p.!5004Q02vGmhy:ref" (ADR-00277224)


Thanks,
 
Google Logo Google Ads API Team

Feedback
How was our support today?

rating1    rating2    rating3    rating4    rating5


 


Reply all
Reply to author
Forward
0 new messages