OfflineCoversionFeedService DateError.INVALID_STRING_DATE_TIME

29 views
Skip to first unread message

Yanhong Zhao

unread,
Sep 25, 2020, 11:41:07 AM9/25/20
to AdWords API and Google Ads API Forum
Hi,

I am operating in a test account with a python client and when I test offline conversion upload, I came across this error:

Error summary: {'faultMessage': "DateError.INVALID_STRING_DATE_TIME @ ; trigger:'2020-09-09T00:00:00 America/Los_Angeles'", 'serviceName': 'OfflineConversionFeedService', 'methodName': 'mutate'}

The script I am using

# Initialize appropriate services.
offline_conversion_feed_service = client.GetService(
    'OfflineConversionFeedService', version='v201809')

# Associate offline conversions with the existing named conversion tracker. If
# this tracker was newly created, it may be a few hours before it can accept
# conversions.
feed = {
    'conversionName': 'Website lead',
    'conversionTime': '2020-09-09T00:00:00 America/Los_Angeles',
    'conversionValue': '8.930611',
    'googleClickId': 'xxxx',
    # Optional: To upload fractional conversion credits, set the external
    # attribution model and credit. To use this feature, your conversion
    # tracker should be marked as externally attributed. To learn more about
    # importing externally attributed conversins, see:
    # 'externalAttributionCredit': 0.3,
    # 'externalAttributionModel': 'Linear'
}

offline_conversion_operation = {
    'operator': 'ADD',
    'operand': feed
}

offline_conversion_response = offline_conversion_feed_service.mutate(
    [offline_conversion_operation])

I have tried every format in the guide but it is always invalid datetime string. I am expecting the code to fail where the datetime might be invalid so not sure what I am doing wrong here.

Best wishes,

Billy

Google Ads API Forum Advisor Prod

unread,
Sep 25, 2020, 4:16:56 PM9/25/20
to billy...@gmail.com, adwor...@googlegroups.com

Hi Yanhong,

Thank you for reaching out. Please give it a try to use “20200909 000000 America/Los_Angeles” as the datetime instead. You may refer to this documentation for the datetime format used in the Adwords API.

Thanks and regards,
Xiaoming, Google Ads API Team


Google Logo
Xiaoming
Google Ads API Team
 


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