Google Ads API Send Offline Conversion

418 views
Skip to first unread message

Aleksandra Nowak

unread,
Dec 21, 2022, 10:29:39 AM12/21/22
to Google Ads API and AdWords API Forum

Hello,


I am trying to upload offline click conversion using REST API.

For this purpose I am using below request:

curl -f --request POST "https://googleads.googleapis.com/v12/customers/${customerId}:uploadClickConversions" \

--header "Content-Type: application/json" \

--header "developer-token: ${developer-token-from-manager-account}" \

--header "login-customer-id: ${manager-account-id}" \

--header "Authorization: Bearer ${my-access-token}" \

--data '{

    "conversions": [

        {

            "gclid": ${my-gclid},

            "conversionAction": "customers/${customerId}/conversionActions/${conversionId}",

            "conversionDateTime": "2022-12-21 12:32:45"

        }

    ],

    "partialFailure": true,

    "validateOnly": false,

    "debugEnabled": true

}'


In response I get this error:


{

  "error": {

    "status": "PERMISSION_DENIED", 

    "message": "The caller does not have permission", 

    "code": 403, 

    "details": [

      {

        "errors": [

          {

            "errorCode": {

              "authorizationError": "USER_PERMISSION_DENIED"

            }, 

            "message": "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-ads/api/docs/concepts/call-structure#cid"

          }

        ], 

        "@type": "type.googleapis.com/google.ads.googleads.v12.errors.GoogleAdsFailure", 

        "requestId": "z71WgTEVZ9Ye7wP4hjCG0g"

      }

    ]

  }

}


Could you verify what I am missing to send the request correctly? How to set up connections between a manager account and a user account?


Thanks in advance!


Google Ads API Forum Advisor

unread,
Dec 21, 2022, 11:52:49 AM12/21/22
to wolowiec...@gmail.com, adwor...@googlegroups.com
Hi,

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

Moving forward to your concern, it seems that you've encountered the USER_PERMISSION_DENIED error. The authorized customer does not have access to the operating customer. The common cause of this is when authenticating as a user with access to a manager account but not specifying login-customer-id in the request. To prevent this kind of error, I would suggest specifying the login-customer-id as the manager account ID without hyphens (-). That being said, you will need to ensure that the user / email address you used to generate the credentials indeed has access to the account in your request.

If the user / email address has access or is associated with the MCC / manager account, you will need to specify the MCC / manager account's ID without hyphens (-) as the value of the login-customer-id field. If the issue still persists, could you please provide the complete request and response logs, with the request-id generated on your end along with the email address used to generate the OAuth2 credentials, so that our team will investigate this problem. Please reply via privately author options.

Thanks,
Google Logo
Nirmita
Google Ads API Team
 


ref:_00D1U1174p._5004Q2hMPal:ref
Reply all
Reply to author
Forward
0 new messages