googleads-python-lib icon indicating copy to clipboard operation
googleads-python-lib copied to clipboard

ConversionTrackerService.mutate responds InternalApiError.UNEXPECTED_INTERNAL_API_ERROR

Open mullakhmetov opened this issue 9 years ago • 1 comments

Hi, I'm experimenting with ConversionTrackerService:

conversion_tracker_service = self.client.GetService('ConversionTrackerService')
operations = [
    {
        'operator': 'ADD',
        'operand': {
            'name': 'test_name',
            'xsi_type': 'AppConversion',
            'appPostBackUrl': 'https://my-app-analytics.com?idfa={md5_advertising_id}&lat={lat}&click_url={click_url}&click_timestamp={click_ts}&trv_campaign_id={campaign_id}&video_id={video_id}'
        }
    }
]
conversion_tracker_service.mutate(operation)

And got:

Server raised fault in response Traceback (most recent call last): File "", line 1, in File "/Users/Artur/Workspace/.virtualenvs/drivers/lib/python3.5/site-packages/googleads/common.py", line 700, in MakeSoapRequest *[_PackForSuds(arg, self.suds_client.factory) for arg in args]) File "/Users/Artur/Workspace/.virtualenvs/drivers/lib/python3.5/site-packages/suds/client.py", line 521, in call return client.invoke(args, kwargs) File "/Users/Artur/Workspace/.virtualenvs/drivers/lib/python3.5/site-packages/suds/client.py", line 581, in invoke result = self.send(soapenv) File "/Users/Artur/Workspace/.virtualenvs/drivers/lib/python3.5/site-packages/suds/client.py", line 619, in send description=tostr(e), original_soapenv=original_soapenv) File "/Users/Artur/Workspace/.virtualenvs/drivers/lib/python3.5/site-packages/suds/client.py", line 670, in process_reply raise WebFault(fault, replyroot) suds.WebFault: Server raised fault: '[InternalApiError.UNEXPECTED_INTERNAL_API_ERROR @ com.google.ads.api.services.common.error.InternalApiError.<init (InternalApiErro]' Server raised fault: '[InternalApiError.UNEXPECTED_INTERNAL_API_ERROR @ com.google.ads.api.services.common.error.InternalApiError.(InternalApiErro]'

Same call w/o appPostbackUrl in operand works well.

operations = [
    {
        'operator': 'ADD',
        'operand': {
            'name': 'test_name',
            'xsi_type': 'AppConversion'
        }
    }
]
conversion_tracker_service.mutate(operation)

(ConversionTrackerReturnValue){ ListReturnValue.Type = "ConversionTrackerReturnValue" value[] = (AppConversion){ id = 232290676 name = "test_name_3" status = "ENABLED" category = "DEFAULT" viewthroughLookbackWindow = 30 ctcLookbackWindow = 30 countingType = "MANY_PER_CLICK" defaultRevenueValue = 1.0 defaultRevenueCurrencyCode = "USD" alwaysUseDefaultRevenueValue = False excludeFromBidding = False attributionModelType = "LAST_CLICK" ConversionTracker.Type = "AppConversion" appId = None appPlatform = "NONE" snippet = None appConversionType = "NONE" appPostbackUrl = None }, }

An attempt to modify already created value causes same error:

operations = [
    {
        'operator': 'SET',
        'operand': {
            'xsi_type': 'AppConversion',
            'id': 232620881,
            'appPostbackUrl': 'https://my-app-analytics.com?idfa={md5_advertising_id}&lat={lat}'
        }
    }
]
conversion_tracker_service.mutate(operations)

appPostbackUrl example copied from here

macOS 10.12.3 Python 3.5 googleads 5.1.0

mullakhmetov avatar Mar 02 '17 14:03 mullakhmetov

Hello,

Thanks for the report! This is actually more of an API-specific error, in the sense that you're able to send API calls and receive error responses. You should send these sorts of questions over to the AdWords API Support forum.

I was able to reproduce your error response with identical code. I did a little tinkering, adding some additional fields to the operand to see what effect it would have. Ultimately, an operand like the following resulted in a potentially more-interesting response:

      'operand': {
          'xsi_type': 'AppConversion',
          'name': 'test_name2',
          'appPostbackUrl': 'https://my-app-analytics.com?idfa={md5_advertising_id}&lat={lat}&click_url={click_url}&click_timestamp={click_ts}&trv_campaign_id={campaign_id}&video_id={video_id}',
          # Added
          'appConversionType': 'IN_APP_PURCHASE',
          'snippet': 'test',
          'appPlatform': 'ANDROID_MARKET',
          'appId': 'abc123doremi'
      }

The response here seems like it may be relevant, indicating that some required macro was not found in appPostbackUrl.

Traceback (most recent call last):
  File "googleads-test-188-conversiontrackerservice.py", line 35, in <module>
    main(adwords_client)
  File "googleads-test-188-conversiontrackerservice.py", line 24, in main
    results = conversion_tracker_service.mutate(operations)
  File "build/bdist.linux-x86_64/egg/googleads/common.py", line 717, in MakeSoapRequest
  File "/usr/local/lib/python2.7/dist-packages/suds/client.py", line 521, in __call__
    return client.invoke(args, kwargs)
  File "/usr/local/lib/python2.7/dist-packages/suds/client.py", line 581, in invoke
    result = self.send(soapenv)
  File "/usr/local/lib/python2.7/dist-packages/suds/client.py", line 619, in send
    description=tostr(e), original_soapenv=original_soapenv)
  File "/usr/local/lib/python2.7/dist-packages/suds/client.py", line 670, in process_reply
    raise WebFault(fault, replyroot)
suds.WebFault: Server raised fault: '[ConversionTrackingError.INVALID_APP_ID @ operations[0].operand.appId, AppPostbackUrlError.REQUIRED_MACRO_NOT_FOUND @ operations[0].operand.appPostbackUrl]

It appears that the API may sometimes return these unhelpfully vague error messages, which is something I would recommend reporting via the support forum.

msaniscalchi avatar Mar 08 '17 16:03 msaniscalchi