Good day - thanks for your response.

I can confirm I have already completed all 1-5 actions described above. 
Service account should be configured correctly, and ready for using.

As to this one:
*    <  Moving forward to NOT_ADS_USER error, yes, it is indeed means that 
the Google account used to generate the access token is not associated with 
any Google Ads account*

I used my Manager Account ID to log in. Let me share my code so that you 
could understand the idea:

*// upload click conversion using the service account credentials and 
developer token of Manager Account*








*Google.Ads.GoogleAds.Config.GoogleAdsConfig config = new() {            
DeveloperToken = _config.DeveloperToken, // developer token set up for the 
manager account            OAuth2SecretsJsonPath = GetCertFilePath(), // 
path to the service account credentials JSON            OAuth2PrnEmail = 
"maintenance@######.#####.###.com", // service account email            
OAuth2Mode = Google.Ads.Gax.Config.OAuth2Flow.SERVICE_ACCOUNT,            
LoginCustomerId = "381-072-4097".Replace("-", ""), // manager account 
customer id };*




*GoogleAdsClient client = new(config);ConversionUploadServiceClient 
conversionUploadService = 
client.GetService(Services.V13.ConversionUploadService);*




*ClickConversion clickConversion = new() {            Gclid = 
googleClickId, // google click ID captured from Google Ad             
ConversionAction = action.GetDescription(),            ConversionDateTime = 
DateTime.Now.ToString("yyyy-mm-dd hh:mm:sszzz")*
*};*





*UploadClickConversionsResponse response =          await 
conversionUploadService.UploadClickConversionsAsync(                    new 
UploadClickConversionsRequest()                    {                        
CustomerId = "465-336-9523**".Replace("-", ""), // Client Google Ads 
account customer ID which I want to upload conversion for*




*                        Conversions = { clickConversion },                
        PartialFailure = true,                        ValidateOnly = false  
                  });*


*Error: "{ ""errorCode"": { ""authenticationError"": ""NOT_ADS_USER"" }, 
""message"": ""User in the cookie is not a valid Ads user."" }"*

The code above tries to upload click conversion for ad created in the 
Client Google Ads account *465-336-9523 *. I use service account 
credentials to log in, and Manager Account ID as LoginCustomerID. Manager 
Account has an access to the Client Google Ads account (added as the 
manager account)

Is this a correct flow? Why do I get the *NOT_ADS_USER*  error for the flow 
above? Manager Account is the Google Ads account indeed. What configuration 
did I miss?

Regards,
Vlad

On Friday, June 23, 2023 at 4:12:14 PM UTC+3 Google Ads API Forum Advisor 
wrote:

> Hi Vlad,
>
> Thank you for reaching out to us.
>
> Moving forward to this, “*I do have all of them set up, however, I'm not 
> sure about the last one. I granted an access for the Ads manager account to 
> have an access to the service account in the Google Console - how I can 
> configure the impersonation?*”
>
>    - Because user impersonation is controlled *only* at the domain level, 
>    using service accounts and assertion flow with Google OAuth2 requires you 
>    to have your own domain registered with Google Workspace. Your app and its 
>    users can then impersonate any user in the domain. 
>
>
>    1. Start by *creating a service account and credentials* 
>    
> <https://developers.google.com/admin-sdk/directory/v1/guides/delegation#create_the_service_account_and_credentials>
>    . 
>    2. Download the service account key in JSON format and note the 
>    service account ID. 
>    3. Share the service account ID and the Google Ads API scope (
>    https://www.googleapis.com/auth/adwords) with your domain 
>    administrator. 
>    4. Request the domain administrator to delegate domain-wide authority 
>    to your service account. 
>    5. If you are the domain administrator, complete the *help center 
>    instructions* <https://support.google.com/a/answer/162106>. 
>
> You can now use the service account to access your Google Ads account with 
> the OAuth2 assertion flow.
>
> You may check this *section 
> (https://developers.google.com/google-ads/api/docs/oauth/service-accounts?hl=en#service_account_access_setup
>  
> <https://developers.google.com/google-ads/api/docs/oauth/service-accounts?hl=en#service_account_access_setup>)*
>  
> of the document for more information.
>
> Moving forward to *NOT_ADS_USER* error, yes, it is indeed means that the 
> Google account used to generate the access token is not associated with any 
> Google Ads account. The login information provided corresponds to a Google 
> account that does not have Google Ads enabled. To handle this, Make sure to 
> sign in with a valid Google Ads account (typically your manager account) 
> for the OAuth flow. You can also invite the Google account to access an 
> existing Google Ads account by signing in to your manager account, 
> selecting the customer or manager account in question, navigating to *Tools 
> and Settings > Access and security*, then adding the Google account email 
> address.
>
> Let me know if you have further questions.
>   
> This message is in relation to case "ref:_00D1U1174p._5004Q2mWOfh:ref"
>
> Thanks,
>   
> [image: Google Logo] Google Ads API Team 
>
>
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/d6f22d51-f5e2-446c-ab58-7b7b5f8f0799n%40googlegroups.com.
  • Se... Vlad
    • ... Vlad
      • ... 'Google Ads API Forum Advisor' via Google Ads API and AdWords API Forum
        • ... RedSpot Admin

Reply via email to