...
| Блок кода | ||||||
|---|---|---|---|---|---|---|
| ||||||
{
"name": "standard_240x400",
"js": "createGIADelement = function(element) {\n var item = document.createElement(\"div\");\n item.setAttribute(\"class\",\"__gi_item\");\n var link = document.createElement(\"a\");\n item.appendChild(link);\n link.setAttribute(\"href\",element['url']);\n link.setAttribute(\"target\",\"_blank\");\n var image = document.createElement(\"img\");\n link.appendChild(image);\n image.setAttribute(\"src\",element['picture']);\n var desc = document.createElement(\"div\");\n link.appendChild(desc);\n desc.setAttribute(\"class\",\"__gi_desc\");\n desc.appendChild(document.createTextNode(element['name']));\n var price = document.createElement(\"div\");\n link.appendChild(price);\n price.setAttribute(\"class\",\"__gi_price\");\n price.appendChild(document.createTextNode(element['price'] + \" \" + element['currencySymbol']));\n\n return item;\n}\n\ncreateGIADlogo = function(logoImg) {\n var logo = document.createElement(\"div\");\n if (logoImg && logoImg!==\"\"){\n logo.setAttribute(\"class\",\"__gi_header\");\n var link = document.createElement(\"a\");\n logo.appendChild(link);\n link.setAttribute(\"href\",\"[[LANDING_PAGE]]\");\n link.setAttribute(\"target\",\"_blank\");\n var sp = document.createElement(\"span\");\n link.appendChild(sp);\n var image = document.createElement(\"img\");\n sp.appendChild(image);\n image.setAttribute(\"src\", logoImg);\n }\n return logo;\n}\n\nvar domain = (typeof __GetI_domain) == \"undefined\" ? \"px.adhigh.net\" : __GetI_domain;\nvar src = ('https:' == document.location.protocol ? 'https://' : 'http://') + domain + '/ad240x400.css';\ndocument.write(\"<link rel='stylesheet' type='text/css' href='\"+src+\"'/>\");\n\nvar container = document.createElement(\"div\");\ncontainer.setAttribute(\"class\",\"_gi_ad_240x400\");\ndocument.getElementById(elementId).appendChild(container);\nvar siteLogo = \"[[SITE_LOGO]]\";\nif (siteLogo){\n siteLogo = ('https:' == document.location.protocol ? 'https://' : 'http://') + siteLogo; \t \n}\ncontainer.appendChild(createGIADlogo(siteLogo));\nfor(var i=0; i<products.length && i<4; i++) {\n container.appendChild(createGIADelement(products[i]));\n}"
} |
Reporting API
Build a Report
| Блок кода | ||
|---|---|---|
| ||
GET https://ui.getintent.com/api/v1/bigdata/reports?token=<token> |
Parameters:
| Parameter | Description | Values | By default | Example |
|---|---|---|---|---|
| token | It's required. Validates if method is available for particular user. Affects on data available for report building according to access settings. | It's string value. Can be found at "My Settings" menu at API tab | null | ../reports?token=tokenstring |
| format | Manages report's format | json - json report format text - text report format divided by tab | text | ../reports?token=<token>&format=json |
| dataset_name | Dataset name | browser_traffic - current campaigns available_inventory - available inventory bidding_performance - bids statistic pixel_traffic - traffic statistic | null | ../reports?token=<token>&dataset_name=browser_traffic |
| start | Report's period start date. End date is required also. | Date at YYYY-mm-dd format | null | ../reports?token=<token>&start=2015-05-01&end=2015-05-31 |
| end | Report's period end date. Start date is required also. | Date at YYYY-mm-dd format | null | ../reports?token=<token>&start=2015-05-01&end=2015-05-31 |
| timezone | Timezone report's period | Timezone name | UTC | ../reports?token=<token>&timezone=Europe/Moscow |
| keys | "Group by" report data fields. Fields can be found at Meta Data | Comma-separated field names | null | ../reports?token=<token>&keys=country,os |
| filter[] | Array for report's output data filtering values. | Filter value's format is op:field:values Each separated value should be specified at new filter[] key op - comparison operation. Available options are eq (is equal) and is_not (is not equal). field - field name values - values for filtered field. If several values are needed, just list them with comma. | null | ../reports?token=<token>&filter[]=eq:country:RU,UA&filter[]=is_not:advertiser_id:27 |
| limit | Output rows number cap. | Max rows number expected | 10000 | ../reports?token=<token>&limit=2000 |
Meta Data
| Блок кода | ||
|---|---|---|
| ||
GET https://ui.getintent.com/api/v1/bigdata/reports/meta_data?token=<token> |
Returns Meta Data for report building.
Working Sample:
| Блок кода | ||||
|---|---|---|---|---|
| ||||
{
"datasets": [
{
"name": "browser_traffic",
"display_name": {
"en": "Campaigns",
"ru": "Кампании"
},
"bq_dataset_name": "browser_traffic",
"key_fields": {
"deal_id": "STRING",
"geo_available": "STRING",
"day": "TIMESTAMP",
...
"zip_code": "STRING"
},
"value_fields": {
"imps": "INTEGER",
"deliv_imps": "INTEGER",
"unique_imps": "INTEGER",
"clicks": "INTEGER",
...
"p_convs": "FLOAT"
},
"dates": [
"2013_12_25",
"2013_12_26",
"2013_12_27",
"2013_12_28",
...
"2015_07_11",
"2015_07_12",
"2015_07_13"
],
"sorting_key_default": {
"day": "asc",
"hour": "asc",
"month": "asc"
}
},
...
{
"name": "pixel_traffic",
...
}
]
} |