new AdWords API, ClickConversion conversion_action how to specify?

2,398 views
Skip to first unread message

Oleksandr Dyklevych

unread,
May 14, 2019, 5:33:49 PM5/14/19
to AdWords API and Google Ads API Forum
Hi,


Currently, I am doing migration from Google.Api.Ads.AdWords.v201809 C# library to new Google.Ads.GoogleAds for Offline Click Conversions Upload.

I am using a managing account which has access to about 20 client accounts, all belong to the same company.

in V20189, everything works like this.
in every managed account, i created "Offline Conversions" action, like on the screenshot:

ConversionAction.jpg

Then, when creating conversion feed, i use "Offline Conversions" as conversion name for a feed entry.
All work fine.

Now, in the new GoogleAds API, i want to upload offline conversions, so i do per documentation, like authenticate client, create service, get list of conversions to upload, and for every conversion i set ConversionAction to "Offline Conversions" name.

However, in the upload response i get errors for all conversions saying:

{ "errorCode": { "requestError": "RESOURCE_NAME_MALFORMED" }, "message": "Resource name 'Offline Conversions' is malformed: expected 'customers/{customer_id}/conversionActions/{ConversionType.conversion_type_id}'.", "trigger": { "stringValue": "Offline Conversions" }, "location": { "fieldPathElements": [ { "fieldName": "conversions", "index": "0" }, { "fieldName": "conversion_action" } ] } }.


Question - how do i specify correctly conversion action in the new GoogleAds API?

i could not find any example online.

Any help is appreciated.

Best regards,
Oleksandr

googleadsapi...@google.com

unread,
May 14, 2019, 11:19:30 PM5/14/19
to AdWords API and Google Ads API Forum
Hi,

Thank you for reaching out. RESOURCE_NAME_MALFORMED occurs when the resource name provided in the request is incorrect. To further investigate this, could you provide the complete JSON request and response logs when you encountered this error? If you haven't enabled logging yet, kindly tell me what client library you are using so I could help you enable it.

Regards,
Dave
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwor...@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscribe@googlegroups.com
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 "AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adwords-api+unsubscribe@googlegroups.com.
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/cd486bde-722b-4b08-b42b-f0f4460da39c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Oleksandr Dyklevych

unread,
May 16, 2019, 2:21:11 AM5/16/19
to AdWords API and Google Ads API Forum
Hi Dave,

i enabled logging as specified in the documentation, and here is the request details:

Method Name: /google.ads.googleads.v1.services.ConversionUploadService/UploadClickConversions
Headers: {
  "x-goog-api-client": "gl-dotnet/4.6.1 gccl/2.0.0 gapic/2.0.0 gax/2.7.0 grpc/1.20.1",
  "developer-token": "REDACTED"
}

{ "customerId": "REDACTED", "conversions": [ { "gclid": "EAIaIQobChMIpeat28qY4gIVyU0YCh16EQ5MEAAYASAAEgIeevD_BwE", "conversionAction": "Offline Conversions", "conversionDateTime": "20190513 204034 Europe/Stockholm", "conversionValue": 100, "currencyCode": "SEK", "orderId": "SE13.05.19.19.52.15-96189" }, { "gclid": "CjwKCAjwq-TmBRBdEiwAaO1enwbj3yTP2XJUWlFlPJtPc9EYVsNahq2vssD8rTvUfI_o2XMYKpUYahoCki8QAvD_BwE", "conversionAction": "Offline Conversions", "conversionDateTime": "20190513 152224 Europe/Copenhagen", "conversionValue": 100, "currencyCode": "DKK", "orderId": "DK13.05.19.15.27.53-81128" }, { "gclid": "CjwKCAjwiN_mBRBBEiwA9N-e_lR60gH04Cl6k4Q-E1-H6-wRjfid4sZOFuJ7SU59IZg3k_6ZJ0sCThoCYMUQAvD_BwE", "conversionAction": "Offline Conversions", "conversionDateTime": "20190513 094811 Europe/Prague", "conversionValue": 100, "currencyCode": "CZK", "orderId": "CZ12.05.19.18.59.17-34482" }, { "gclid": "EAIaIQobChMI59HJ0uOR4gIVzuR3Ch1PRA4sEAAYASAAEgKIMvD_BwE", "conversionAction": "Offline Conversions", "conversionDateTime": "20190510 134211 Europe/Amsterdam", "conversionValue": 100, "currencyCode": "EUR", "orderId": "NL10.05.19.22.18.04-23966" } ], "partialFailure": true }

And, here is the response:
Headers: {
  "content-disposition": "attachment",
  "request-id": "7lXeBIFyPB0TmRNx8k50NQ",
  "date": "Wed, 15 May 2019 22:52:31 GMT",
  "alt-svc": "quic=\":443\"; ma=2592000; v=\"46,44,43,39\""
}

{ "partialFailureError": { "code": 3, "message": "Multiple errors in ‘details’. First error: Resource name 'Offline Conversions' is malformed: expected 'customers/{customer_id}/conversionActions/{ConversionType.conversion_type_id}'., at conversions[0].conversion_action", "details": [ { "@type": "type.googleapis.com/google.ads.googleads.v1.errors.GoogleAdsFailure", "@value": "CtEBCgIIBBKLAVJlc291cmNlIG5hbWUgJ09mZmxpbmUgQ29udmVyc2lvbnMnIGlzIG1hbGZvcm1lZDogZXhwZWN0ZWQgJ2N1c3RvbWVycy97Y3VzdG9tZXJfaWR9L2NvbnZlcnNpb25BY3Rpb25zL3tDb252ZXJzaW9uVHlwZS5jb252ZXJzaW9uX3R5cGVfaWR9Jy4aFSoTT2ZmbGluZSBDb252ZXJzaW9ucyImEg8KC2NvbnZlcnNpb25zEgASEwoRY29udmVyc2lvbl9hY3Rpb24K0wEKAggEEosBUmVzb3VyY2UgbmFtZSAnT2ZmbGluZSBDb252ZXJzaW9ucycgaXMgbWFsZm9ybWVkOiBleHBlY3RlZCAnY3VzdG9tZXJzL3tjdXN0b21lcl9pZH0vY29udmVyc2lvbkFjdGlvbnMve0NvbnZlcnNpb25UeXBlLmNvbnZlcnNpb25fdHlwZV9pZH0nLhoVKhNPZmZsaW5lIENvbnZlcnNpb25zIigSEQoLY29udmVyc2lvbnMSAggBEhMKEWNvbnZlcnNpb25fYWN0aW9uCtMBCgIIBBKLAVJlc291cmNlIG5hbWUgJ09mZmxpbmUgQ29udmVyc2lvbnMnIGlzIG1hbGZvcm1lZDogZXhwZWN0ZWQgJ2N1c3RvbWVycy97Y3VzdG9tZXJfaWR9L2NvbnZlcnNpb25BY3Rpb25zL3tDb252ZXJzaW9uVHlwZS5jb252ZXJzaW9uX3R5cGVfaWR9Jy4aFSoTT2ZmbGluZSBDb252ZXJzaW9ucyIoEhEKC2NvbnZlcnNpb25zEgIIAhITChFjb252ZXJzaW9uX2FjdGlvbgrTAQoCCAQSiwFSZXNvdXJjZSBuYW1lICdPZmZsaW5lIENvbnZlcnNpb25zJyBpcyBtYWxmb3JtZWQ6IGV4cGVjdGVkICdjdXN0b21lcnMve2N1c3RvbWVyX2lkfS9jb252ZXJzaW9uQWN0aW9ucy97Q29udmVyc2lvblR5cGUuY29udmVyc2lvbl90eXBlX2lkfScuGhUqE09mZmxpbmUgQ29udmVyc2lvbnMiKBIRCgtjb252ZXJzaW9ucxICCAMSEwoRY29udmVyc2lvbl9hY3Rpb24=" } ] }, "results": [ { }, { }, { }, { } ] }

googleadsapi...@google.com

unread,
May 16, 2019, 4:39:42 AM5/16/19
to AdWords API and Google Ads API Forum

Hi,


Thank you for providing the complete logs. Upon checking, you are passing an incorrect value to the field conversion_action which is Offline Conversions. As stated on this guide, conversion_action is the resource name of the conversion action associated with this conversion. This being said, can you try to pass the correct resource name and then try to make the API call again?


Regards,

Dave

Google Ads API Team




=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Message has been deleted
Message has been deleted

Oleksandr Dyklevych

unread,
May 16, 2019, 11:56:11 AM5/16/19
to AdWords API and Google Ads API Forum
Hi Dave,

i read that guide, but it is not clear where i should get actual value for conversion_action.

Once again, under each managed account i created a conversion action and gave it name "Offline Conversions".

here is what i mean:

ConversionActions.jpg



in old  Google.Api.Ads.AdWords.v201809 C# library i used conversion feed object and set conversion name attribute to "Offline Conversions". Then, i used managing account to upload the feed, and it was automatically put under correct managed account under this conversion action "Offline Conversions", and all works fine.

where can i get correct name for conversion action which i need to set in the new library? Can i see it anywhere in Google Ads portal under account settings or properties?
To me, "Offline Conversions" is correct name as per screenshot.

googleadsapi...@google.com

unread,
May 17, 2019, 2:20:11 AM5/17/19
to AdWords API and Google Ads API Forum
Hi,

The resource name is different from name. You may check this guide to see the difference of resource name and name. To get the resource name of the conversion_action, you may use the ConversionActionService.GetConversionAction() method. After getting the correct resource name, you may try to call the API again. If the error persists after putting the correct resource name, feel free to write back so I could assist you further.

Regards,
Dave
Google Ads API Team


=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
    https://ads-developers.googleblog.com/search/label/google_ads_api
    https://developers.google.com/adwords/api/community/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Was your question answered? Please rate your experience with us by taking a short survey.
If not -- reply to this email and tell us what else we can do to help.

Take Survey

Also find us on our blog and discussion group:
http://googleadsdeveloper.blogspot.com/search/label/adwords_api
https://developers.google.com/adwords/api/community/

Oleksandr Dyklevych

unread,
May 17, 2019, 7:14:56 AM5/17/19
to AdWords API and Google Ads API Forum
Hi Dave,


I still cannot get it. 

you say "To get the resource name of the conversion_action, you may use the ConversionActionService.GetConversionAction() method". But, per documentation, "resource_name" is the parameter i need to supply to GetConversionAction(). So, to get request name what should i supply there?

I try simple
            ConversionActionServiceClient conversionActionService = client.GetService(Services.V1.ConversionActionService);
            GetConversionActionRequest conversionActionRequest = new GetConversionActionRequest();

            conversionActionRequest.ResourceName = "Offline Conversions";

            try
            {
                ConversionAction converisonAction = conversionActionService.GetConversionAction(conversionActionRequest);
            }
            catch(Exception e)
            {

            }

it throws error {{ "errors": [ { "errorCode": { "requestError": "BAD_RESOURCE_ID" }, "message": "'Offline Conversions' part of the resource name is invalid." } ] }}.

So, how do i get i right?

My task is following:
for every managed account i created conversion action name "Offline Conversions".

i can get every conversion from back-end with required attributes - gclid, date time, timezone, value, currency.

The above is enough to upload offline conversions via Google.Api.Ads.AdWords.v201809 library, but for new library i am missing this one piece called ConversionAction.
How do i get it working in the new Google.Ads.GoogleAds library?

The best way would be to illustrate with code or point to an example.

Oleksandr Dyklevych

unread,
May 17, 2019, 7:46:17 AM5/17/19
to AdWords API and Google Ads API Forum
To be more specific, this is a piece of code that works in Google.Api.Ads.AdWords.v201809

                    OfflineConversionFeed feed = new OfflineConversionFeed();
                    feed.conversionName = "Offline Conversions";
                    feed.conversionTime = "2019-05-13 20:40:34 Europe/Stockholm";
                    feed.conversionValue = 100d;
                    feed.conversionCurrencyCode = "SEK";
                    feed.googleClickId = "EAIaIQobChMIpeat28qY4gIVyU0YCh16EQ5MEAAYASAAEgIeevD_BwE";

                    OfflineConversionFeedOperation offlineConversionOperation =
                        new OfflineConversionFeedOperation();
                    offlineConversionOperation.@operator = Operator.ADD;
                    offlineConversionOperation.operand = feed;

                    OfflineConversionFeedReturnValue offlineConversionRetval =
                        offlineConversionFeedService.mutate(
                            new OfflineConversionFeedOperation[] { offlineConversionOperation });

Before running above, i authenticate and authorize my client from managing account, say "111111111", and the conversion is uploaded co conversion action under a managed account "22222222". So, i do not even know which account it belongs to, i just use one centralized managing account and upload all conversions at once.

How can i achieve similar with new Google.Ads.GoogleAds library?

Oleksandr Dyklevych

unread,
May 27, 2019, 5:40:03 AM5/27/19
to AdWords API and Google Ads API Forum
Is there any update on the topic?
What is the best way to proceed?

Google Ads API Forum Advisor Prod

unread,
May 27, 2019, 10:47:26 PM5/27/19
to adwor...@googlegroups.com
Hi,

I am a colleague of Dave, allow me to provide support for your concern. Sorry for the delayed response, my colleague was able to respond to you privately. However, it seems that the response did not reach you. Kindly refer to the response below.

The format of the resource name you need as a parameter for ConversionActionService.GetConversionAction() method is customers/{customer_id}/conversionActions/{conversion_action_id}. You could get the conversion_action_id by using GAQL query to get from conversion_action resource.

Sample query: 
SELECT conversion_action.id FROM conversion_action.

After fetching the conversion_action.id, you may then use it to get the conversion action. Feel free to write back if you have further clarifications.

Regards,
Dannison
Google Ads API Team

ref:_00D1U1174p._5001UAq7Dn:ref

Oleksandr Dyklevych

unread,
May 28, 2019, 3:38:21 AM5/28/19
to AdWords API and Google Ads API Forum

Hi Danisson,

yes, i've tried this way, and it kind of works.
But, it introduces a new issue, namely, for each conversion, i need to know which account it is coming from. Then i need to go to that account and find out conversion action resource name with GAQL, because each of them has different resource name for same "Offline Conversions" action.

However, the problem is that i do not know which accounts conversions are coming from.
I work from one managing account which has about 20+ managed account under it. i know only this managing account and i have a bunch of conversions in our back-end systems coming from these 20+ accounts.

And, as i provided an example for Google.Api.Ads.AdWords.v201809, i do not even care now which of these 20+ managed accounts the conversions are coming from. I upload them from my managing account, but somehow they appear under proper managed account after uploading.

Now, in the new API, I need to know account for each conversion. It will be quite cumbersome and time consuming logic with a lot of trial and errors, and unnecessary calls to API, in my opinion.
Is there any easy way to do it in Google.Ads.GoogleAds without knowing which account each conversion is coming from?


Google Ads API Forum Advisor Prod

unread,
May 29, 2019, 3:27:40 AM5/29/19
to adwor...@googlegroups.com
Hi Dannison,

Just to be clear, you wish to get the owners of these individual conversion actions. Is this correct? You can include conversion_action.owner_customer in the GAQL to get the owners of each conversion. Let me know if this helps. 

Oleksandr Dyklevych

unread,
May 29, 2019, 1:47:03 PM5/29/19
to AdWords API and Google Ads API Forum
Hi Dannison,

No, not owners of conversion actions.
i need to know, for example, which of 20+ managed accounts the conversion with gclid "EAIaIQobChMIpeat28qY4gIVyU0YCh
16EQ5MEAAYASAAEgIeevD_BwE" belongs to.

then, i would need to get resource name from that account, and only then upload the conversion.

That looks tedious comparing to this code for Google.Api.Ads.AdWords.v201809 which i provided above.

                    OfflineConversionFeed feed = new OfflineConversionFeed();
                    feed.conversionName = "Offline Conversions";
                    feed.conversionTime = "2019-05-13 20:40:34 Europe/Stockholm";
                    feed.conversionValue = 100d;
                    feed.conversionCurrencyCode = "SEK";
                    feed.googleClickId = "EAIaIQobChMIpeat28qY4gIVyU0YCh16EQ5MEAAYASAAEgIeevD_BwE";

                    OfflineConversionFeedOperation offlineConversionOperation =
                        new OfflineConversionFeedOperation();
                    offlineConversionOperation.@operator = Operator.ADD;
                    offlineConversionOperation.operand = feed;

                    OfflineConversionFeedReturnValue offlineConversionRetval =
                        offlineConversionFeedService.mutate(
                            new OfflineConversionFeedOperation[] { offlineConversionOperation });


So, the question is - how to get account by knowing only gclid? is that possible to do in efficient way, not running requests one by one?

Google Ads API Forum Advisor Prod

unread,
May 30, 2019, 2:23:34 AM5/30/19
to adwor...@googlegroups.com
Hi,

I am afraid that there is no direct way to know who manages the GCLID as of the moment except for downloading the click_view report.

Oleksandr Dyklevych

unread,
Jun 19, 2019, 8:11:28 AM6/19/19
to AdWords API and Google Ads API Forum
yes, but how comes it is working with no problem in Google.Api.Ads.AdWords.v201809 under the hood?
what shall i do when Google.Api.Ads.AdWords.v201809 gets deprecated?

Google Ads API Forum Advisor Prod

unread,
Jun 19, 2019, 11:05:10 PM6/19/19
to adwor...@googlegroups.com

Hi Oleksandr,

It seems that you did not receive my private message sent previously. Cascading the message here.

The Google Ads API will mostly reflect the feature in the AdWords API. In AdWords API perspective, the only way to also know who owns the GCLID is also by downloading the Click Performance Report.  

Based on the code snippet you provided, this will also fail if the GCLID does not belong to the current account being used to run the code.



Regards,
Dannison
Google Ads API Team



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