Module Expr Str Import alias Import alias Import alias ImportFrom alias Assign NameStore Str FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad NameLoad attr Str keyword Str Assign NameStore Str Assign NameStore Call AttributeLoad Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr SubscriptLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Index Num Str Str Str Str Str attr Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Dict Str Str Str Str Str Str Str BinOpMod Str Call AttributeLoad NameLoad attr NameLoad Dict Str Str Str Str NameLoad ListLoad Dict Str Str Str Str Str Str NameLoad BinOpMod Str Call AttributeLoad NameLoad attr Dict Str Str Str Str Str Str Dict Str Str Str Str Str Str Dict Str Str Str Str Str Str Dict Str Str Str Str Str Str Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr ListLoad NameLoad Index Num Print BinOpMod Str TupleLoad SubscriptLoad NameLoad Index Str SubscriptLoad NameLoad Index Str Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index Str decorator_list If CompareEq NameLoad Str body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Expr Call NameLoad NameLoad NameLoad
N/A N/A This code example creates a new template creative for a given advertiser.

To determine which companies are advertisers, run get_advertisers.py.
To determine which creative templates exist, run
get_all_creative_templates.py.

The LoadFromStorage method is pulling credentials and properties from a
"googleads.yaml" file. By default, it looks for this file in your home
directory. For more information, see the "Caching authentication information"
section of our README.

 N/A base64 N/A os N/A uuid googleads dfp N/A ADVERTISER_ID INSERT_ADVERTISER_COMPANY_ID_HERE main N/A N/A client advertiser_id N/A N/A N/A creative_service N/A N/A client GetService CreativeService version v201505 N/A creative_template_id 10000680 N/A image_data N/A N/A N/A open N/A N/A N/A os path join N/A N/A N/A N/A os path split __file__ N/A 0 .. .. data medium_rectangle.jpg r read N/A image_data N/A N/A base64 encodestring image_data N/A creative N/A xsi_type name advertiserId size creativeTemplateId creativeTemplateVariableValues TemplateCreative N/A Template Creative #%s N/A N/A uuid uuid4 advertiser_id N/A width height 300 250 creative_template_id N/A N/A xsi_type uniqueName assetByteArray fileName AssetCreativeTemplateVariableValue Imagefile image_data N/A image%s.jpg N/A N/A uuid uuid4 N/A xsi_type uniqueName value LongCreativeTemplateVariableValue Imagewidth 300 N/A xsi_type uniqueName value LongCreativeTemplateVariableValue Imageheight 250 N/A xsi_type uniqueName value UrlCreativeTemplateVariableValue ClickthroughURL www.google.com N/A xsi_type uniqueName value StringCreativeTemplateVariableValue Targetwindow _blank N/A creative N/A N/A N/A creative_service createCreatives N/A creative N/A 0 N/A N/A Template creative with id '%s', name '%s', and type '%s' was created and can be previewed at %s. N/A N/A creative N/A id N/A creative N/A name N/A N/A dfp DfpClassType creative N/A creative N/A previewUrl N/A N/A N/A __name__ __main__ N/A N/A dfp_client N/A N/A N/A dfp DfpClient LoadFromStorage N/A N/A main dfp_client ADVERTISER_ID