Setting up Google ADS API for the offline conversion upload service

371 views
Skip to first unread message

Reketec

unread,
Jun 19, 2020, 4:53:22 AM6/19/20
to AdWords API and Google Ads API Forum
Hi there,

We are an online store that sells refurbished IT equipment and we use Google Ads to promote our business and products. We only advertise for our website and don’t manage ads for anyone else.

When a client pay via bank transfer the only way to verify that conversion is to wait for the money to arrive to our bank account. Then what we normally do is confirm that quote manually and make it an order by clicking   "Confirm" button in our backend. What we want to do is by means of the offline conversion upload service, upload the conversion when confirming the order.

I´ve created as a Web application the following credentials:





For the refresh token my developper run the python code in here https://github.com/googleads/googleads-python-lib/blob/master/examples/adwords/authentication/generate_refresh_token.py which takes him to a link for granting access to My Ads API integration, he gave me the link but when I try to open it it takes me here:

Previously I have already had to create a Google Ads Manager account to obtain the developers token (right now as a test account, but I have applied for the basic Access here https://services.google.com/fb/forms/newtoken/), and enabled in my project the Google Ads API. ¿Should I enable in my project the Token Service API also?

¿Any Idea of what might be happening?

Best,

Pablo


Google Ads API Forum Advisor Prod

unread,
Jun 19, 2020, 1:47:29 PM6/19/20
to reket...@gmail.com, adwor...@googlegroups.com

Hi Pablo,

Thank you for reaching out. You encountered this error as you did not add the Authorized redirect URIs. Please follow these instructions to add in the Authorized redirect URIs in the Google API console and try it again. Let me know if you have any further concerns.

Thanks and regards,
Xiaoming, Google Ads API Team


 

ref:_00D1U1174p._5004Q217n6H:ref

Reketec

unread,
Jun 20, 2020, 4:04:21 AM6/20/20
to AdWords API and Google Ads API Forum
Thank you very much Xiaoming,

I´ve made the changes, on Monday I´ll check with my developper and update the situation.

Best,

Pablo

Reketec

unread,
Jun 22, 2020, 4:48:25 AM6/22/20
to AdWords API and Google Ads API Forum
Hi there,

now we received the following error message:

Fault: errors {
  error_code {
    authorization_error: DEVELOPER_TOKEN_NOT_APPROVED
  }
  message: "The developer token is not approved. Non-approved developer tokens can only be used with test accounts."
}

Is it because my approval is still pending? I have already applied for the Basic Access but it hasn´t been approved yet.



Best,

Pablo

Google Ads API Forum Advisor Prod

unread,
Jun 22, 2020, 11:07:20 AM6/22/20
to reket...@gmail.com, adwor...@googlegroups.com

Hi Pablo,

Thank you for reaching out. Yes, your are right. DEVELOPER_TOKEN_NOT_APPROVED errors occurs as you were trying to make API calls against a production account with a developer token that has test access. You would have to either wait for your upgrade approved or make calls to a test account using this developer token.



Thanks and regards,
Xiaoming, Google Ads API Team


 

ref:_00D1U1174p._5004Q217n6H:ref

Reketec

unread,
Jun 24, 2020, 7:15:11 AM6/24/20
to AdWords API and Google Ads API Forum
We are almost there:

We still don´t have the conversions after waiting several days and I think the problem is conversion_action_id. Our developper use the name which is "Transferencia bancaria" but I see that an INT64 is expected (https://developers.google.com/google-ads/api/fields/v2/conversion_action#conversion_action.id).

How can I know what´s the  conversion_action_id?

Best,

Pablo

El viernes, 19 de junio de 2020, 10:53:22 (UTC+2), Reketec escribió:

Reketec

unread,
Jun 24, 2020, 8:37:41 AM6/24/20
to AdWords API and Google Ads API Forum
Ok I think I see the problem:

First we were using as a conversion_action_id "Transferencia bancaria" this is like that because when Google helped me setting up the conversion action, they told me to set it up as a click conversion, not purchase, thereforo we didn´t see the conversion_action_id.

Now we are going to create another conversion action as a purchase action, then we´ll be able to really use the ID:


With this another question occurs to me:

I have my normal Google Ads client account, but for being able to use the API and get a Developer Token I had to create another Administrator Account. Will I be able using the API and being the Conversion action in my client account to upload the conversion? does the fact that I use things from different accounts (even though they are linked) mean any problem?

Should I upload the conversion in a specific conversion action or can I use an existing one?

Best,

Pablo





El viernes, 19 de junio de 2020, 10:53:22 (UTC+2), Reketec escribió:

Google Ads API Forum Advisor Prod

unread,
Jun 24, 2020, 2:23:58 PM6/24/20
to reket...@gmail.com, adwor...@googlegroups.com

Hi Pablo,

Thank you for reaching out. You could upload the Conversion in your client account given the fact that you use things from different accounts. You could refer to the cross-account conversion tracking for more information. It’s not necessary for you to upload the conversion in a specific conversion action.



Thanks and regards,
Xiaoming, Google Ads API Team


 

ref:_00D1U1174p._5004Q217n6H:ref

Reketec

unread,
Jun 24, 2020, 4:42:29 PM6/24/20
to AdWords API and Google Ads API Forum
Hi Xiaoming,

Thank you very much for clarifying my questions.

Now my developer gives me the following error:

partial_failure_error {
  code: 3
  message: "The string date time\'s format should be yyyy-mm-dd hh:mm:ss+|-hh:m., at conversions[0].conversion_date_time"
  details {
    type_url: "type.googleapis.com/google.ads.googleads.v2.errors.GoogleAdsFailure"
    value: "The string date time\'s format should be yyyy-mm-dd hh:mm:ss+|-hh:m.\032\032*\0302020-05-14 22:52:57+0200\")\022\017\n\013conversions\022\000\022\026\n\024conversion_date_time"

Even though he is sending the date as teh following format '2020-05-14 22:52:57+0200'

Any Idea about how to debug this error?

Best,

Pablo

El viernes, 19 de junio de 2020, 10:53:22 (UTC+2), Reketec escribió:

Reketec

unread,
Jun 25, 2020, 9:33:39 AM6/25/20
to AdWords API and Google Ads API Forum
Hi there,

Last error resolved, now we have a different error:

partial_failure_error:
code: 3
message: "This customer does not have an import conversion action that matches the conversion action provided., at conversions[0].conversion_action"
details {
  type_url: "type.googleapis.com/google.ads.googleads.v2.errors.GoogleAdsFailure"
  value: "\n\307\001\n\003\370\006\t\022dThis customer does not have an import conversion action that matches the conversion action provided.\0322*0customers/DELETED1/conversionActions/DELETED2\"&\022\017\n\013conversions\022\000\022\023\n\021conversion_action"
}

Any Idea?

El viernes, 19 de junio de 2020, 10:53:22 (UTC+2), Reketec escribió:

Google Ads API Forum Advisor Prod

unread,
Jun 25, 2020, 2:25:34 PM6/25/20
to reket...@gmail.com, adwor...@googlegroups.com

Hi Pablo,

Thank you for reaching out. Please make sure that you use the exact same spelling and capitalization that you did when you created this conversion action in your Google Ads account.



Thanks and regards,
Xiaoming, Google Ads API Team



 

ref:_00D1U1174p._5004Q217n6H:ref

Pete Lavetsky (AdWords API Guru)

unread,
Jun 25, 2020, 2:29:38 PM6/25/20
to AdWords API and Google Ads API Forum
Also getting this same error ... attempting to upload click conversions.

Here's the Conversion Action I'm attempting to upload to ... does everything look ok for uploading clicks?

conversionAction=

resource_name : customers/ABC/conversionActions/123

id : 123

name : "ABCCBA"

status : ENABLED

type : UPLOAD_CLICKS

category : PAGE_VIEW

owner_customer : "customers/ABC"

include_in_conversions_metric : true

click_through_lookback_window_days : 30

view_through_lookback_window_days : 30


default_value : 1.0

default_currency_code : "USD"

always_use_default_value : 

counting_type : ONE_PER_CLICK


attribution_model : GOOGLE_ADS_LAST_CLICK

data_driven_model_status : NEVER_GENERATED

phone_call_duration_seconds : 60


Does the error ( "does not have an import conversion action that matches the conversion action provided" ) mean the Conversion Action needs a different Type or Category in order for Click Conversions to be uploaded?

Thanks
Pete

Reketec

unread,
Jun 26, 2020, 6:41:36 AM6/26/20
to AdWords API and Google Ads API Forum
Hi Xiaoming,

Thank you for your answer.

In our case since we are using python I don´t think that the spelling affects us since we obtain conversion_action from customer_id and conversion_action_id:


Any other idea?

Best,

Pablo

El viernes, 19 de junio de 2020, 10:53:22 (UTC+2), Reketec escribió:

Google Ads API Forum Advisor Prod

unread,
Jun 26, 2020, 12:44:45 PM6/26/20
to reket...@gmail.com, adwor...@googlegroups.com

Hi Pete and Pablo,

Thank you for reaching out. Could you please share the Conversion Action you were uploading and the complete request and response logs along with the client customer account you were uploading to via the Reply privately to author option for me to further investigate?



Thanks and regards,
Xiaoming, Google Ads API Team



 

ref:_00D1U1174p._5004Q217n6H:ref

Reketec

unread,
Jul 17, 2020, 3:34:45 AM7/17/20
to AdWords API and Google Ads API Forum

"This customer does not have an import conversion action that matches the conversion action provided., at conversions[0].conversion_action"

We have two accounts, the manager that we have just for the API and the normal one where we have set up all of our campaings. We have tried:
1. 
customer_id: Not manager account
conversion_action_id: manager account
2. 
customer_id: manager account
conversion_action_id: manager account
3.
customer_id: not manager account
conversion_action_id: not manager account

In all of the tree combinations we have the same error.

Please we would really appreciate some help.

Best,

Pablo

Pete Lavetsky (AdWords API Guru)

unread,
Jul 17, 2020, 8:18:42 AM7/17/20
to AdWords API and Google Ads API Forum
Hi Pablo,

I'm assuming this is a cross account conversion tracking problem.

If there's only two accounts in the entirety of your account hierarchy it should be pretty straight forward. If not, reply back and I'll walk you through the hoops we had to jump through to figure this out.

What you want to do is construct the ClickConversion object like normal and then use the manager CID as the customer_id on your mutate.

Using the Java library we do something along the lines of:

ConversionUploadServiceClient conversionUploadServiceClient = ...
conversionUploadServiceClient.uploadClickConversions( managerCID, listOfClickConversions, partialFailureTrue, validateOnlyFalse);

The important part is the managerCID, which is going to be different than the CID of the account you think you're uploading the ConversionAction for.

Again, I can walk you through what we did if the above doesn't work but it should be straight forward if you are sure you only have two accounts you need to deal with.

Pete

Google Ads API Forum Advisor Prod

unread,
Jul 17, 2020, 2:52:16 PM7/17/20
to reket...@gmail.com, adwor...@googlegroups.com

Hi Pablo,

Thank you for reaching out. You would need to upload the click conversion to the account that contains the conversion action. If you still have concerns, please share the Conversion Action you were uploading and the complete request and response logs along with the manager account and client customer account you were uploading to via the Reply privately to author option for me to further investigate.




Thanks and regards,
Xiaoming, Google Ads API Team



 

ref:_00D1U1174p._5004Q217n6H:ref

Michel Baretti

unread,
Jul 21, 2020, 9:35:37 AM7/21/20
to AdWords API and Google Ads API Forum
Hi,

I am receiving the same error. Is there any problem with this service?

Reketec

unread,
Jul 21, 2020, 9:41:08 AM7/21/20
to AdWords API and Google Ads API Forum
Hi there,

Apparently  I am using conversion_id and not conversion_action_id. I was getting it from here:

Where can I find conversion_action_id?

Thanks in advance

Pablo

Michel Baretti

unread,
Jul 21, 2020, 9:48:48 AM7/21/20
to AdWords API and Google Ads API Forum
In this page, in the URL, there is a parameter ctId. You can  check if correct, calling the conversionActionServiceClient.getConversionAction

Reketec

unread,
Jul 21, 2020, 10:05:01 AM7/21/20
to AdWords API and Google Ads API Forum
Thanks Michel, I went back to my developper and I´ll update with the results.

I have been trying to get this information online and I haven´t found anything, about this, where can I find information about this parameters in the URL?
ocid
ctId
euid
u
uscid
c
authuser=0
subid

Best,

Pablo

Michel Baretti

unread,
Jul 21, 2020, 10:18:49 AM7/21/20
to AdWords API and Google Ads API Forum
I have created a conversion action using the api. 
I could verify that the action conversion id that the API response has given me, was the same as the value of the URL parameter. 
I have not found any other place where I can check the action conversion id from an action conversion created in the Google Ads account.

Google Ads API Forum Advisor Prod

unread,
Jul 21, 2020, 2:56:57 PM7/21/20
to reket...@gmail.com, adwor...@googlegroups.com

Hi Pablo,

Thank you for reaching out. As I said, you are supposed to add in the conversion_action_id rather than the conversion_id in your code. The one you got is the conversion id not the conversion action id. You could log into your customer account and navigate to the TOOLS & SETTINGS -> Conversions, and under the Conversion action tab you could find the existing conversion actions and their ids in your account. In your case, you used the conversion_id as the conversion_action_id but apparently it does not exist in your account. 




Thanks and regards,
Xiaoming, Google Ads API Team



 

ref:_00D1U1174p._5004Q217n6H:ref

Google Ads API Forum Advisor Prod

unread,
Jul 21, 2020, 3:02:17 PM7/21/20
to mbar...@leadtech.com, adwor...@googlegroups.com

Hi Michel,

Thank you for reaching out. If you are not able to find the action conversion id, you could log into your customer account and navigate to the TOOLS & SETTINGS -> Conversions, then you can find the existing conversion actions and their ids in your account under the Conversion action tab. 




Thanks and regards,
Xiaoming, Google Ads API Team



 

ref:_00D1U1174p._5004Q217n6H:ref
Message has been deleted

Reketec

unread,
Jul 21, 2020, 5:49:31 PM7/21/20
to AdWords API and Google Ads API Forum
Hi Xiaoming,

Sorry if I´m being "slow", but where in this screenshot?


Is the text in the column "Conversion action" the conversion_action_id?

Best,

Pablo

Reketec

unread,
Jul 21, 2020, 5:52:17 PM7/21/20
to AdWords API and Google Ads API Forum
Hi Xiaoming,

Sorry if I´m being "slow"... but where in the attached screenshot is the conversion_action_id? is the text in conversion action column the conversion_action_id?

Best,

Pablo

El martes, 21 de julio de 2020, 20:56:57 (UTC+2), adsapiforumadvisor escribió:
image (3).png

Michel Baretti

unread,
Jul 22, 2020, 3:32:02 AM7/22/20
to AdWords API and Google Ads API Forum
Hi Xiaoming,

Again, I take the number from de URL, and use the service conversionActionServiceClient.getConversionAction and works. It's returns the conversion action. There isn't the conversion action id who the Google Ads API requires in the Google Ads account -> TOOLS & SETTINGS -> Conversion.
My problem is the error "This customer does not have an import conversion action that matches the conversion action provided., at conversions[0].conversion_action"

I am using java library 
ConversionUploadServiceClient conversionUploadServiceClient = ...
conversionUploadServiceClient.uploadClickConversions( mccId, listOfClickConversions, true, false);

I tried sent with the mccId and the object ClickConversion with the customerId and didn't work.
I tried the same that Pablo, all the combinations and didn't work.

Thanks
MIchel.

Pete Lavetsky (AdWords API Guru)

unread,
Jul 22, 2020, 8:30:48 AM7/22/20
to AdWords API and Google Ads API Forum
Michel + Pablo:

Here's what you do:

Via the API, look at the Customer object for the CID you're attempting to upload the ConversionAction for.

crossAccountConversionTrackingId = getCustomer().getConversionTrackingSetting().getCrossAccountConversionTrackingId()

Now iterate through the Customer objects of other CIDs in your MCC and match crossAccountConversionTrackingId value with getCustomer().getConversionTrackingSetting().getConversionTrackingId()

The CID of the Customer that matches the above is the CID that you want to use as your "mccId" in conversionUploadServiceClient.uploadClickConversions( mccId, listOfClickConversions, true, false);

Hope this helps
Pete

Michel Baretti

unread,
Jul 22, 2020, 8:50:52 AM7/22/20
to AdWords API and Google Ads API Forum
Hi, but I do not understand.
I did a customerServiceClient.getCustomer.
I can recover the ConversionTrackingId, its the same the tab Tag setup, in TOOLS & SETTINGS -> Conversion.
But the crossAccountConversionTrackingId it's null.

Michel Baretti

unread,
Jul 22, 2020, 9:59:56 AM7/22/20
to AdWords API and Google Ads API Forum
I have my mcc id ZZZ-ZZZ-ZZZZ
i have my customer account ID XXX-XXX-XXXX
Inside my customer account I created a conversion action, the conversion action Id it's YYYYYYYYY..
The conversion_tracking_id it's the same the conversion id VVVVVVVVV

What value should I send in the attributes "?????"

String conversionActionResourceName =ResourceNames.conversionAction( ?????, ????? ));

// Creates the click conversion.
ClickConversion clickConversion =
                 ClickConversion.newBuilder()
.                  setConversionAction(StringValue.of(conversionActionResourceName))
                   ......
                     .build();

conversionUploadServiceClient.uploadClickConversions(Long.toString( ????? ),ImmutableList.of(clickConversion),true,false);

Google Ads API Forum Advisor Prod

unread,
Jul 22, 2020, 11:39:26 AM7/22/20
to reket...@gmail.com, adwor...@googlegroups.com

Hi Pablo,

Thank you for reaching out. If that’s the case, please query the conversion_action.id field from the conversion_action resource. You would be able to get all the conversion action ids in your account.



Thanks and regards,
Xiaoming, Google Ads API Team



 

ref:_00D1U1174p._5004Q217n6H:ref

Google Ads API Forum Advisor Prod

unread,
Jul 22, 2020, 11:52:34 AM7/22/20
to mbar...@leadtech.com, adwor...@googlegroups.com

Hi Michel,

Thank you for reaching out. You could also fetch the conversion_action.id by querying the conversion_action resource. Please try using Pete’s solution to match the crossAccountConversionTrackingId value and use that CID as the mccId in the method. 



Thanks and regards,
Xiaoming, Google Ads API Team



 

ref:_00D1U1174p._5004Q217n6H:ref

Google Ads API Forum Advisor Prod

unread,
Jul 22, 2020, 2:48:32 PM7/22/20
to mbar...@leadtech.com, adwor...@googlegroups.com
Hi Michel,

Thanks for reaching out. With regards to your concern, you can query the conversion_action.id field from the conversion_action resource. You would be able to get all the conversion action ids in your account. We have shared the solution ongoing thread if that does not resolve the issue. Please continue the discussion on that thread to avoid duplicates.

Thanks,
Nirmita Patel Google Ads Team

ref:_00D1U1174p._5004Q22YB6P:ref

Michel Baretti

unread,
Jul 23, 2020, 2:47:10 AM7/23/20
to AdWords API and Google Ads API Forum
Hi,

I have not been able to retrieve the crossAccountConversionTrackingId.
I fetch the customer resource.  In all my customers the crossAccountConversionTrackingId is null.
How can I generate the crossAccountConversionTrackingId? By api or by Google Ads UI?

Thanks

Google Ads API Forum Advisor Prod

unread,
Jul 23, 2020, 3:15:15 PM7/23/20
to mbar...@leadtech.com, adwor...@googlegroups.com

Hi Michel,

Thank you for reaching out. In order for me to further investigate your issue, could you please share the complete request and response logs via the Reply privately to author option?



Thanks and regards,
Xiaoming, Google Ads API Team



 

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