Posts under category google-ads-api

I have generated developer_token, access_token and refresh token with googleads read permission. While using in code using google-ads-api I am getting below error.

Code:

from google.ads.googleads.client import GoogleAdsClient googleads_client = GoogleAdsClient.load_from_storage(path="./googleads.yaml", version="v14") 

Error:

  googleads_client = GoogleAdsClient.load_from_storage(path="./googleads.yaml", version="v14") 

I followed this tutorial to generate developer token, access token and refresh_token.

Here is permissions in the app and during authorization screenshot

I am creating bigquery data transfer service for google ads data. the data transfer service was created successfully. while retrieving the data the transfer service is getting failed with below error.

generic::permission_denied: Error while processing subtask:  The caller does not have permission Raw error response from Google Ads API: { "error": { "code": 403, "message": "The caller does not have permission", "errors": [ { "message": "The caller does not have permission", "domain": "global", "reason": "forbidden", "debugInfo": "detail: \"[ORIGINAL ERROR] generic::permission_denied: User doesn\\'t have permission to access customer. Note: If you\\'re accessing a client customer, the manager\\'s customer id must be set in the \\'login-customer-id\\' header. See https://developers.google.com/google- 

I checked the google documentation the user should have permissions in google ads and GCP as well

in my case both of them are different user,for example my email id in GCP is different and my email id in google ads is different.

once i setup the transfer service i updated the credentials with update credentials option. which mean i authorized retransfer using the email id which has access to google ads.

the update credentials step was success didn't throw any error,

even after this my data transfer is failing with same error.

is it not at possible use different user to authorize google ads data transfer?

how can i solve this problem.

I was using Google Ads API v12 in python until today (28/08/2023). It's now deprecated and I'm not able to pull data from v13 or v14. Can someone help? My script is very similar to the one on the google documentation. Here they are simply replacing the version number and have

googleads_client = GoogleAdsClient.load_from_storage(version="v14")

https://developers.google.com/google-ads/api/samples/get-account-hierarchy?hl=it#python

Making no changes to this script and running it on my computer I have the following error:

ModuleNotFoundError: No module named 'google.ads.googleads.v14' ValueError: Specified Google Ads API version "v14" does not exist. Valid API versions are: "v8", "v7" 

I have the following packages installed: google-ads 14.0.0 and googleads 39.0.0

Thank you

So I am trying to send ga ecommerce events such as "add_to_cart" or "begin_checkout". Now, in the event objects, I am confused as to what price to mention in the items array of the event object. Do I mention the discounted price or the full price?

Allow me to elaborate with examples.

gtag("event", "purchase", {     transaction_id: "T_12345",     coupon: "socksSale",     value: 12.00, // value = quantity x sale price     currency: "USD", // The currency of the value, discount, and price     items: [      {       item_id: "SKU_12345",       item_name: "Socks",       discount: 2.00, // The discount per item       price: 4.00, // The sale price is the per item list price (6.00) minus discount (2.00)       quantity: 3 // The number of items sold     },     ] }); 

This example is taken directly from here: https://developers.google.com/analytics/devguides/collection/ga4/apply-discount?client_type=gtag

Now, in the above example, Google states that the price of the items must be the discounted price:

The sale price is the per item list price (6.00) minus discount (2.00)

Now, consider another example. (Again from Google)

gtag("event", "add_to_cart", {   currency: "USD",   value: 7.77,   items: [     {       item_id: "SKU_12345",       item_name: "Stan and Friends Tee",       affiliation: "Google Merchandise Store",       coupon: "SUMMER_FUN",       discount: 2.22,       index: 0,       item_brand: "Google",       item_category: "Apparel",       item_category2: "Adult",       item_category3: "Shirts",       item_category4: "Crew",       item_category5: "Short sleeve",       item_list_id: "related_products",       item_list_name: "Related Products",       item_variant: "green",       location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo",       price: 9.99,       quantity: 1     }     ] }); 

This example is taken directly from here: https://developers.google.com/analytics/devguides/collection/ga4/reference/events?client_type=gtag#add_to_cart

Here, the item price is clearly not the discounted price as the event value is this price minus the item discount e.g. The full price.

The above examples show a clear contradiction in the guidelines.

I was able to find one relevant question on Stack Overflow here: What Discount property means in Google Analytics 4? . The only answer here states that item prices should be the full prices.

Now, I understand that one can send either of the 2 types of prices as they are the ones who have to interpret the reports afterwards. However, I am sending the data to Google Ads from Google Analytics as well. And, I do not want to report inaccurate data. So, what is the more standard/accepted method of reporting item prices?