Solution:

request.conversions.append(click_conversion)
request.partial_failure = True
conversion_upload_response = (
conversion_upload_service.upload_click_conversions(
request=request,
)
)
request.conversions[:0]

On Thursday, January 6, 2022 at 6:14:40 PM UTC panu.kuu...@hopkins.fi wrote:

> The code sample in 
> https://developers.google.com/google-ads/api/docs/conversions/upload-clicks?hl=en#python
>  
> seems to have an issue. 
>
> This line request.conversions = [click_conversion] returns an error:
>
> AttributeError: Assignment not allowed to repeated field "conversions" in 
> protocol message object.
>
> My click_conversions looks like: 
>
> gclid: 
> "Cj0KCQiAw9qOBhC-ARIsAG-rdn7H0PLLPzj19IIWAKcoYz63zoYwV4Ca-_82RkyvIVAVPSGTHvHpnAIaAi5_EALw_wcB"
> conversion_action: "customers/000000000/conversionActions/000000"
> conversion_date_time: "2022-01-06 19:30:06+02:00"
> conversion_value: 1.28
> currency_code: "USD"
> custom_variables {
>   conversion_custom_variable: "type"
>   value: "purchase"
> }
>
> I suppose one is not allowed to assign to repeated fields but I don't see 
> how to proceed. I think appending with 
> request.conversions.append(click_conversion) creates a malformed request.
>
> Anyone got a clue on how to get this to work?
>
> Thank you for your help
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
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 adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@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 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/0b7a8da9-3ea3-49a2-b221-2aef1a3b1aben%40googlegroups.com.

Reply via email to