Posts tagged with google-ad-manager

Hi I have been using rest methods to integrate Google Ads API in C#. Everything seemed to be working fine but all of sudden I started getting 400 response with the error message.

{     "error": "invalid_grant",     "error_description": "Token has been expired or revoked." } 

As mentioned above that I am not using client library but instead using restsharp and testing all my end points using postman also.

Any reason why it is happening? My refresh token is also valid. I have been using this for one week. I have also not reached to the limit of refresh token as I have only generated refresh token 3 to 4 times when I was trying to set up the accounts.

I believe the validity of refresh token is life long then why it is happening?

I am trying to Create a Client test account under Test manager account of google ads API but my test manager account is marked as closed. See below

As mentioned in the picture a, we need to use new google account to create test manager account that is not been used in production manager account, I did the same. I created new google account and created test manager account but when I try to generate Refresh token for test account by using OAuth playground, It generates an error. see picture b.

Picture a.

Picture b.

Am I doing something wrong to configure the test manager account? Is there anything I need to follow to enable test account? The request to generate refresh token is getting denied. Is it because my account is closed?

I'm trying to figure out if this works. Unfortunately I do not have a website to test this with. Though I've read the GA and GAds documentation I'm not sure if this is possible. So please bear with me.

Imagine a simple website that has Google Analytics (with a linked GAds account) deployed. I want to run a survey on this site users can answer if they like to. As the result of the survey the participants are assigned some ID. Lets say the result variable is called cluster and the values are A, B or C.

What I want to do now, is use this group of participants of the survey and try to target new visitors that are similar to the ones that have been assigned a C value via Google Ads.

As far as I understood the documentations this is how it could be done. Please correct me and point me in the right direction if I'm wrong.

  1. I'm setting up a custom user dimension called Cluster in GA
  2. I'm editing the GA code on the website to include the custom dimension that will be populated with the result of the mentioned survey
  3. When the results come into GA, I'm creating a remarketing audience in GA called Cppl based on the custom dimension Cluster
  4. I'm importing this Cppl remarketing audience into GAds
  5. I'm creating a similar audience in GAds based on Cppl list
  6. I'm publishing a campaign based on this similar audience

Does this process make sense and is it correct or am I making any mistakes?

I am trying to pull report from google ad manager using API

  report_job = {   'reportQuery': {       'dimensions': ['AD_EXCHANGE_DATE', 'AD_EXCHANGE_COUNTRY_NAME'],       'columns': ['AD_EXCHANGE_AD_REQUESTS', 'AD_EXCHANGE_IMPRESSIONS',                   'AD_EXCHANGE_ESTIMATED_REVENUE','AD_EXCHANGE_AD_ECPM'],       'dateRangeType': 'LAST_WEEK',       'timeZoneType': 'AD_EXCHANGE',  # Run in pacific time       'adxReportCurrency': 'USD'   }   }

I suspect the downloaded report has very wired ECPM and Revenue values. as below

Please help if i am doing something wrong, as the ECPM has to be very low and the revenue as well.

I need some help with the google ad manager API. I am trying to delete a lineitem with the following:

from googleads import ad_manager client = ad_manager.AdManagerClient.LoadFromStorage() def test(id):     line_item_service = client.GetService('LineItemService',version='v202002')     line_item_name = str(id)     statement = (ad_manager.StatementBuilder(version='v202002').Where('OrderId = :OrderId').WithBindVariable('OrderId',app.config['AD_MANAGER']['ORDER_ID']))         response = line_item_service.performLineItemAction(line_item_service.DeleteLineItems(),statement.ToStatement()) 

My problem lies with DeleteLineItems() as I am not sure how to call it correctly. I am not able to find clear usage examples, hence my attempt above. Below are the docs I could find. The error of my current attempt is:

{success: false, error: "<class 'googleads.errors.GoogleAdsValueError'>", message: "Service DeleteLineItems not found"} 

https://developers.google.com/ad-manager/api/reference/v202011/LineItemService.DeleteLineItems https://developers.google.com/ad-manager/api/reference/v202011/LineItemService#performLineItemAction