Marketing API Version

Business

Fields

created_by, creation_time, id, name, primary_page, timezone_id, update_time, updated_by, vertical_id

Business.get_insights (fields, params, async)

Name Type Description Required

fields

array

A list of fields to read.

No

params

map

A mapping of request parameters where a key is the parameter name and its value is a string or an object which can be JSON-encoded.

No

async

boolean

Whether or not to call this asynchronously.

No

Sample Code

business = Business('1454288444842444')
insights = business.get_insights(fields=[
    Insights.Field.campaign_id,
    Insights.Field.unique_clicks,
    Insights.Field.impressions,
], params={
    'level': Insights.Level.campaign,
    'date_preset': Insights.Preset.yesterday,
})
print insights

Business.get_product_catalogs (fields, params)

Returns an iterator that lists product catalogs associated with the business

Name Type Description Required

fields

array

A list of fields to read.

No

params

map

A mapping of request parameters where a key is the parameter name and its value is a string or an object which can be JSON-encoded.

No

Sample Code

business = Business('1454288444842444')
catalogs = business.get_product_catalogs()
if catalogs:
    print catalogs[0]