Why uploadConversionAdjustments API raises ACTION_NOT_PERMITTED error

292 views
Skip to first unread message

Ryo

unread,
Dec 26, 2022, 4:00:09 AM12/26/22
to Google Ads API and AdWords API Forum
Thank you for reading my question.

I have a question about cause of the ACTION_NOT_PERMITTED error.

I requested basic access of the Google Ads API and I was approved.
Moreover, I can request customers:listAccessibleCustomers API.

What's the cause of the error?
Where should I get the additional permission? In the Google Ads account, Google Ads account(MCC), OAuth or what...?

# request(Node.js)
## request access_token
await fetch('https://www.googleapis.com/oauth2/v3/token', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      grant_type: 'refresh_token',
      client_id: clientId,
      client_secret: clientSecret,
      refresh_token: refreshToken,
    }),
  });

## call the API
await fetch('https://googleads.googleapis.com/v12/customers/${customerId}:uploadConversionAdjustments', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${accessToken}`,
      'developer-token': developerToken // from the API center of the MCC account
    },
    body: JSON.stringify({
      conversionAdjustments: [
        {
          adjustment_type: 'ENHANCEMENT',
          userIdentifiers: [
            {
              addressInfo: {
                hashed_first_name: convertToSHA256(firstName),
                hashed_last_name: convertToSHA256(lastName),
                postal_code: convertToSHA256(postalCode),
                state: convertToSHA256(prefecture),
                city: convertToSHA256(city),
                hashed_street_address: convertToSHA256(streetAddress),
              }
            }
          ],
          orderId,
          conversionAction,
        }
      ],
      partialFailure: true,
      validateOnly: true
    }),
  });


# response
"error":{"code":403,"message":"The caller does not have permission","status":"PERMISSION_DENIED","details":[{"@type":"type.googleapis.com/google.ads.googleads.v12.errors.GoogleAdsFailure","errors":[{"errorCode":{"authorizationError":"ACTION_NOT_PERMITTED"},"message":"The user does not have permission to perform this action on the resource or call a method."}],"requestId":""}]}}

Google Ads API Forum Advisor

unread,
Dec 27, 2022, 5:18:41 AM12/27/22
to ryoma...@antway.co.jp, adwor...@googlegroups.com

Hi Ryo,

Thanks for reaching out to the Google Ads API Forum.

The AuthorizationError.ACTION_NOT_PERMITTED error occurs when the user does not have permission to perform this action (e.g., ADD, UPDATE, REMOVE) on the resource or call a method. You encountered said error because you are using the credentials with adequate access level. You may need to have at least standard access level to upload the enhanced conversion to Google Ads via Google Ads API. 

For your question “Where should I get the additional permission? In the Google Ads account, Google Ads account(MCC), OAuth or what...?”, you may refer to the steps shown under "How to edit access level" section of this guide to edit the access level.

In Google Ads API perspective, as an administrator, you can get the list of users with access to an account by building a Google Ads Query Language statement to query all the CustomerUserAccess entities associated with a customer ID. Here is a typical query:
 

SELECT

  customer_user_access.user_id,

  customer_user_access.email_address,

  customer_user_access.access_role,

  customer_user_access.access_creation_date_time,

  customer_user_access.inviter_user_email_address

FROM customer_user_access

For more information, you may refer to this page. In addition, you may refer to the sample JSON required to pass in your REST API request:

 

{

  "conversionAdjustments": [

   

{

  "gclidDateTimePair": {

    object (GclidDateTimePair)

  },

  "adjustmentType": enum (ConversionAdjustmentType),

  "restatementValue": {

    object (RestatementValue)

  },

  "userIdentifiers": [

    {

      object (UserIdentifier)

    }

  ],

  "orderId": string,

  "conversionAction": string,

  "adjustmentDateTime": string,

  "userAgent": string

}

 

  ],  "partialFailure": boolean,  "validateOnly": boolean}

 

For more information, you may check this guide.

Regards,

Google Logo
Yasar
Google Ads API Team
 


ref:_00D1U1174p._5004Q2hNq3J:ref

Ryo

unread,
Dec 27, 2022, 11:32:55 PM12/27/22
to Google Ads API and AdWords API Forum
Hi Yasar,

Thanks for your quick reply.

I could solve the issue based on your advice.
Thanks a lot.

Best regards,
Ryo

2022年12月27日火曜日 19:18:41 UTC+9 adsapi:
Reply all
Reply to author
Forward
0 new messages