Upload HTML5 via Ads API to an App Campaign

52 views
Skip to first unread message

Renan Duarte Ribeiro dos Santos

unread,
Oct 6, 2019, 9:49:48 AM10/6/19
to AdWords API and Google Ads API Forum
Hi all,

I have been trying to upload an HTLM5 file using the Google Ads API.
Here is part of the code I am using:

# Create Media
    media_file = media_file_operation.create
    media_file.id.value = 123435
    media_file.type = client.get_type('MediaTypeEnum', version='v2').MEDIA_BUNDLE
    media_file.mime_type = client.get_type('MimeTypeEnum', version='v2').HTML5_AD_ZIP
    
  
    zf = open('/teste/teste.html.zip', 'rb').read()
    

    media_file.media_bundle.data.value=zf

    # Add media
    
    try:
    media_file_response = media_file_service.mutate_media_files(customer_id, [media_file_operation])

     except google.ads.google_ads.errors.GoogleAdsException as ex:
         print('Request with ID "%s" failed with status "%s" and includes the '
               'following errors:' % (ex.request_id, ex.error.code().name))
         for error in ex.failure.errors:
             print('\tError with message "%s".' % error.message)
             if error.location:
                 for field_path_element in error.location.field_path_elements:
                     print('\t\tOn field: %s' % field_path_element.field_name)


    media_file_resource_name=media_file_response.results[0].resource_name
    
    return media_file_resource_name


However I am facing the following error:

Request made: ClientCustomerId: 6365753748, Host: googleads.googleapis.com:443, Method: /google.ads.googleads.v2.services.MediaFileService/MutateMediaFiles, RequestId: mnNVhyrI6CkRofYeJ4VsXA, IsFault: True, FaultMessage: Custom exits not allowed in HTML5 entry.
Request with ID "mnNVhyrI6CkRofYeJ4VsXA" failed with status "INVALID_ARGUMENT" and includes the following errors:
	Error with message "Custom exits not allowed in HTML5 entry."

Does anybody know what part am I doing incorrectly or even if it's possible to add an HTML5 via API to an App Campaign?

Kind regards,

Google Ads API Forum Advisor Prod

unread,
Oct 7, 2019, 4:58:07 PM10/7/19
to renan....@wildlifestudios.com, adwor...@googlegroups.com
Hello Renan,

Looks like the error is related to this post. The error means that the JavaScript embedded in the HTML you're uploading contains modified clickability. Specifically, somewhere in the code there is a call to ExitApi.exit(). The above post might give you some resources in how to fix the HTML and get it uploaded. In general it is possible to upload HTML5s via APP campaigns. 

Regards,
Sai Teja, Google Ads API Team

ref:_00D1U1174p._5001UKMK1u:ref

Renan Duarte Ribeiro dos Santos

unread,
Oct 14, 2019, 10:09:32 PM10/14/19
to Google Ads API Forum Advisor Prod, adwor...@googlegroups.com
Hi Sai,

Thank you again for your help.
Well, I have been talking with my dev team and they rose a question.
If we don't  use the ExitApi.exit() method then the entire area of my playable is clickable, this means that if the user clicks once, for example trying to play the playable ads, he/she is directed to the Play Store, what is quite nonsense, right? I have a playables ads that cannot be played.

We tried to remove the ExitApi.exit() method and the Ads API worked perfectly, so currently I have a working Ads API that uploads unuseful playable ads.(LoL)

Do you know what should we do?
Is there another method that we should do instead? 
--

 

Renan Duarte

User Acquisition


11 97433 0388 

São Paulo | Brasil

wildlifestudios.com

Reply all
Reply to author
Forward
0 new messages