{"_id":"57719980c755ca0e00617d31","__v":2,"category":{"_id":"57717aee3dd24019004c9122","project":"568af724176a6c0d00a29ec4","version":"568af725176a6c0d00a29ec7","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-06-27T19:13:50.805Z","from_sync":false,"order":5,"slug":"reporting","title":"Reporting"},"editedParams":true,"parentDoc":null,"project":"568af724176a6c0d00a29ec4","user":"568af6d197d8960d0012ab7d","editedParams2":true,"version":{"_id":"568af725176a6c0d00a29ec7","project":"568af724176a6c0d00a29ec4","__v":11,"createdAt":"2016-01-04T22:50:13.289Z","releaseDate":"2016-01-04T22:50:13.289Z","categories":["568af725176a6c0d00a29ec8","56d9d397337fd11300d6a3e3","56d9d4287222d50b0070160b","56f424307ea0091700f63ac5","56f45babcb0dce29005a8e85","5739e5836c5ba134007a197d","57717aee3dd24019004c9122","5771b5d8c755ca0e00617d7d","579639964913990e001a5911","57e57e7df3d7fc0e009c5119","587569b6f4483a0f00d2e6b8"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":["59dad68ff07c79001a1fc5ba"],"next":{"pages":[],"description":""},"createdAt":"2016-06-27T21:24:16.433Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"name":"","code":"{\n    \"queryProfile\":{\n        \"accountId\":1234567,\n        \"currency\":\"USD\",\n        \"measure\":\"revenue\",\n        \"campaignId\":null,\n        \"product\":null,\n        \"device\":null,\n        \"startDate\":\"2016-01-01\",\n        \"endDate\":\"2016-01-31\"\n    },\n    \"columnHeaders\":[\n        {\n            \"name\":\"date\",\n            \"dataType\":\"DATE\"\n        },\n        {\n            \"name\":\"revenue\",\n            \"dataType\":\"CURRENCY\"\n        }\n    ],\n    \"rows\":{\n        \"campaigns\":{\n            \"all\":{\n                \"id\":\"all\",\n                \"name\":\"ALL\",\n                \"products\":{\n                    \"all\":{\n                        \"code\":\"all\",\n                        \"name\":\"ALL\",\n                        \"revenue\":[\n                            [\n                                \"2016-01-01\",\n                                3787.01\n                            ],\n                            [\n                                \"2016-01-02\",\n                                632.37\n                            ],\n                            [\n                                \"2016-01-03\",\n                                571.41\n                            ],\n                            [\n                                \"2016-01-04\",\n                                694.55\n                            ],\n                            [\n                                \"2016-01-05\",\n                                859.79\n                            ],\n                            [\n                                \"2016-01-06\",\n                                620.38\n                            ],\n                            [\n                                \"2016-01-07\",\n                                505.9\n                            ],\n                            [\n                                \"2016-01-08\",\n                                362.51\n                            ],\n                            [\n                                \"2016-01-09\",\n                                559.93\n                            ],\n                            [\n                                \"2016-01-10\",\n                                579.19\n                            ],\n                            [\n                                \"2016-01-11\",\n                                603.33\n                            ],\n                            [\n                                \"2016-01-12\",\n                                596.56\n                            ],\n                            [\n                                \"2016-01-13\",\n                                688.39\n                            ],\n                            [\n                                \"2016-01-14\",\n                                589.74\n                            ],\n                            [\n                                \"2016-01-15\",\n                                463.74\n                            ],\n                            [\n                                \"2016-01-16\",\n                                412.29\n                            ],\n                            [\n                                \"2016-01-17\",\n                                614.74\n                            ],\n                            [\n                                \"2016-01-18\",\n                                855.09\n                            ],\n                            [\n                                \"2016-01-19\",\n                                616.32\n                            ],\n                            [\n                                \"2016-01-20\",\n                                559.84\n                            ],\n                            [\n                                \"2016-01-21\",\n                                491.82\n                            ],\n                            [\n                                \"2016-01-22\",\n                                405.53\n                            ],\n                            [\n                                \"2016-01-23\",\n                                307.65\n                            ],\n                            [\n                                \"2016-01-24\",\n                                394.34\n                            ],\n                            [\n                                \"2016-01-25\",\n                                572.97\n                            ],\n                            [\n                                \"2016-01-26\",\n                                674.76\n                            ],\n                            [\n                                \"2016-01-27\",\n                                592.25\n                            ],\n                            [\n                                \"2016-01-28\",\n                                451.77\n                            ],\n                            [\n                                \"2016-01-29\",\n                                361.07\n                            ],\n                            [\n                                \"2016-01-30\",\n                                315.55\n                            ],\n                            [\n                                \"2016-01-31\",\n                                404.89\n                            ]\n                        ]\n                    }\n                }\n            }\n        }\n    }\n}","language":"json","status":200},{"name":null,"code":"{\n    \"error\": {\n        \"errors\": [\n            {\n                \"reason\": \"invalidParameter\",\n                \"message\": \"Invalid product requested. Please use all, convert, insert, spotlight\",\n                \"locationType\": \"parameter\",\n                \"location\": \"product\"\n            }\n        ]\n    },\n    \"code\": 400,\n    \"message\": \"Invalid product requested. Please use all, convert, insert, spotlight\"\n}","language":"json","status":400},{"status":401,"language":"json","code":"{\n    \"error\": {\n        \"errors\": [\n            {\n                \"reason\": \"invalidCredentials\",\n                \"message\": \"Authorization secret is missing or invalid. This can be found at https://publishers.viglink.com/account and can be sent as a parameter or Authorization header\",\n                \"locationType\": \"parameter\",\n                \"location\": \"secret\"\n            }\n        ]\n    },\n    \"code\": 401,\n    \"message\": \"Authorization secret is missing or invalid. This can be found at https://publishers.viglink.com/account and can be sent as a parameter or Authorization header\"\n}"},{"code":"{\n    \"error\": {\n        \"errors\": [\n            {\n                \"reason\": \"internalServerError\",\n                \"message\": \"An unexpected error occurred, but we are looking into it\"\n            }\n        ]\n    },\n    \"code\": 500,\n    \"message\": \"An unexpected error occurred, but we are looking into it\"\n}","language":"text","status":500}]},"settings":"57717d5327a5c20e00030dbd","examples":{"codes":[{"code":"<?php\n$ch = curl_init(\"https://rest.viglink.com/api/performance/daily?measure=revenue&startDate=2016-01-01&endDate=2016-01-31\");\n\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: secret YOUR SECRET KEY'));\n\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n$response = curl_exec($ch);\n\ncurl_close($ch);","language":"php"},{"language":"ruby","code":"require 'httparty'\n\nurl = \"https://rest.viglink.com/api/performance/daily?measure=revenue&startDate=2016-01-01&endDate=2016-01-31\"\n\nheaders = {Authorization: \"secret {SECRET KEY}\"}\n\nresponse = HTTParty.get(url, headers: headers)"},{"code":"curl -i -X GET -H \"Authorization: secret {SECRET KEY}\" 'https://rest.viglink.com/api/performance/daily?measure=revenue&startDate=2016-01-01&endDate=2016-01-31'","language":"curl"}]},"method":"get","auth":"required","params":[{"_id":"577199de45c7080e0072925c","ref":"","in":"query","required":false,"desc":"Measure 1 of 6 available metrics: clicks, ctr, epc, pageviews, revenue, sales","default":"revenue","type":"string","name":"measure"},{"_id":"577180b22d37b20e00c845a9","ref":"","in":"query","required":false,"desc":"Numeric ID of your campaign(s)","default":"NULL","type":"array_int","name":"campaignId"},{"_id":"577180b22d37b20e00c845a8","ref":"","in":"query","required":false,"desc":"Lowercase instance of a product (all, convert, insert or spotlight)","default":"NULL","type":"array_string","name":"product"},{"_id":"577181be2f16442900771117","ref":"","in":"query","required":false,"desc":"Lowercase device type (all, unknown, desktop, tablet, mobile)","default":"NULL","type":"array_string","name":"device"},{"_id":"577181be2f16442900771116","ref":"","in":"query","required":false,"desc":"Start of requested time series","default":"-31 Days","type":"yyyy-mm-dd","name":"startDate"},{"_id":"577181be2f16442900771115","ref":"","in":"query","required":false,"desc":"End of requested time series","default":"-1 Day","type":"yyyy-mm-dd","name":"endDate"},{"_id":"577181be2f16442900771113","ref":"","in":"query","required":false,"desc":"Lowercase format of response: json or xml","default":"json","type":"string","name":"format"},{"_id":"577181be2f16442900771112","ref":"","in":"query","required":false,"desc":"JSON-P callback method name","default":"NULL","type":"string","name":"callback"}],"url":"/performance/daily"},"isReference":false,"order":1,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Authorization Header\",\n  \"body\": \"You must add authorization headers to this request.\\n```Authorization: secret {SECRET KEY}```\\n\\n<b>Replace {SECRET KEY} above with any secret key from any campaign in your account.</b> You can find a secret key in your [VigLink account](https://publishers.viglink.com/account). When logged into your dashboard, go to Manage > Account. Under the My Campaign sub-heading, copy a Secret Key. If you don’t have one, click “Get a Secret Key\\\" on any of your campaigns.\"\n}\n[/block]\nThis endpoint can be used to measure the daily performance for one of the six metrics available: `clicks`, `ctr`, `epc`, `pageviews`, `revenue`, and `sales`. The `rows` index is grouped first by `campaignId`, followed by `product` before the daily revenue is returned.\n\n##Metric Description\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Metric\",\n    \"h-1\": \"dataType\",\n    \"0-0\": \"revenue\",\n    \"0-1\": \"`CURRENCY`\",\n    \"1-0\": \"epc\",\n    \"1-1\": \"`CURRENCY`\",\n    \"2-0\": \"ctr\",\n    \"2-1\": \"`PERCENT`\",\n    \"3-0\": \"clicks\",\n    \"3-1\": \"`INTEGER`\",\n    \"4-0\": \"pageviews\",\n    \"4-1\": \"`INTEGER`\",\n    \"5-0\": \"sales\",\n    \"5-1\": \"`CURRENCY`\",\n    \"0-2\": \"Your commissions or revenue, after VigLink's share. These commissions are still subject to returns and adjustments.\",\n    \"h-2\": \"Description\",\n    \"1-2\": \"Earnings per click. This is calculated by clicks / revenue.\",\n    \"2-2\": \"Click-through Rate. This calculated by clicks / pageviews * 100.\",\n    \"3-2\": \"Only clicks that are considered affiliatable are counted toward this metric.\",\n    \"4-2\": \"Calculated pageviews when VigLink Convert or Insert JavaScript is used.\",\n    \"5-2\": \"Gross sales generated for all merchants from your affiliate clicks.\"\n  },\n  \"cols\": 3,\n  \"rows\": 6\n}\n[/block]\n##Query Profile Index\n\nA `queryProfile` index is returned to provide insight into changed parameters (if invalid), default parameters used for the report and additional account data returned from the request.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"queryProfile\\\":{\\n    \\\"accountId\\\":1234567,\\n    \\\"currency\\\":\\\"USD\\\",\\n    \\\"measure\\\":\\\"revenue\\\",\\n    \\\"campaignId\\\":null,\\n    \\\"product\\\":null,\\n    \\\"device\\\":null,\\n    \\\"startDate\\\":\\\"2016-01-01\\\",\\n    \\\"endDate\\\":\\\"2016-01-31\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n##Column Headers Index\n\nAn additional `columnHeaders` index is made available that defines each enumerated column in the daily performance array for the selected metric in the `rows` index. This is designed to cut down on the size of the response, and to provide a definition of the type of data the value represents.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"columnHeaders\\\":[\\n    {\\n        \\\"name\\\":\\\"date\\\",\\n        \\\"dataType\\\":\\\"DATE\\\"\\n    },\\n    {\\n        \\\"name\\\":\\\"revenue\\\",\\n        \\\"dataType\\\":\\\"CURRENCY\\\"\\n    }\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nThe possible values for dataType are: `STRING`, `INTEGER`, `PERCENT`, `TIME`, `DATE`, `CURRENCY`, `FLOAT`.\n\nMap the enumerative indexes for each daily performance array row to the `columnHeaders` index to define \"2016-01-01\" as `date` of the dataType `DATE`, and 3787.01 as `revenue` of the dataType `CURRENCY`.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\\\"revenue\\\":[\\n    [\\n        \\\"2016-01-01\\\",\\n        3787.01\\n    ]\\n]\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","excerpt":"Get the daily performance of your campaign metrics.","slug":"daily-performance","type":"endpoint","title":"Daily Performance"}

getDaily Performance

Get the daily performance of your campaign metrics.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

measure:
stringrevenue
Measure 1 of 6 available metrics: clicks, ctr, epc, pageviews, revenue, sales
campaignId:
array of integersNULL
Numeric ID of your campaign(s)
product:
array of stringsNULL
Lowercase instance of a product (all, convert, insert or spotlight)
device:
array of stringsNULL
Lowercase device type (all, unknown, desktop, tablet, mobile)
startDate:
yyyy-mm-dd-31 Days
Start of requested time series
endDate:
yyyy-mm-dd-1 Day
End of requested time series
format:
stringjson
Lowercase format of response: json or xml
callback:
stringNULL
JSON-P callback method name

Examples


Result Format


Documentation

[block:callout] { "type": "warning", "title": "Authorization Header", "body": "You must add authorization headers to this request.\n```Authorization: secret {SECRET KEY}```\n\n<b>Replace {SECRET KEY} above with any secret key from any campaign in your account.</b> You can find a secret key in your [VigLink account](https://publishers.viglink.com/account). When logged into your dashboard, go to Manage > Account. Under the My Campaign sub-heading, copy a Secret Key. If you don’t have one, click “Get a Secret Key\" on any of your campaigns." } [/block] This endpoint can be used to measure the daily performance for one of the six metrics available: `clicks`, `ctr`, `epc`, `pageviews`, `revenue`, and `sales`. The `rows` index is grouped first by `campaignId`, followed by `product` before the daily revenue is returned. ##Metric Description [block:parameters] { "data": { "h-0": "Metric", "h-1": "dataType", "0-0": "revenue", "0-1": "`CURRENCY`", "1-0": "epc", "1-1": "`CURRENCY`", "2-0": "ctr", "2-1": "`PERCENT`", "3-0": "clicks", "3-1": "`INTEGER`", "4-0": "pageviews", "4-1": "`INTEGER`", "5-0": "sales", "5-1": "`CURRENCY`", "0-2": "Your commissions or revenue, after VigLink's share. These commissions are still subject to returns and adjustments.", "h-2": "Description", "1-2": "Earnings per click. This is calculated by clicks / revenue.", "2-2": "Click-through Rate. This calculated by clicks / pageviews * 100.", "3-2": "Only clicks that are considered affiliatable are counted toward this metric.", "4-2": "Calculated pageviews when VigLink Convert or Insert JavaScript is used.", "5-2": "Gross sales generated for all merchants from your affiliate clicks." }, "cols": 3, "rows": 6 } [/block] ##Query Profile Index A `queryProfile` index is returned to provide insight into changed parameters (if invalid), default parameters used for the report and additional account data returned from the request. [block:code] { "codes": [ { "code": "\"queryProfile\":{\n \"accountId\":1234567,\n \"currency\":\"USD\",\n \"measure\":\"revenue\",\n \"campaignId\":null,\n \"product\":null,\n \"device\":null,\n \"startDate\":\"2016-01-01\",\n \"endDate\":\"2016-01-31\"\n}", "language": "json" } ] } [/block] ##Column Headers Index An additional `columnHeaders` index is made available that defines each enumerated column in the daily performance array for the selected metric in the `rows` index. This is designed to cut down on the size of the response, and to provide a definition of the type of data the value represents. [block:code] { "codes": [ { "code": "\"columnHeaders\":[\n {\n \"name\":\"date\",\n \"dataType\":\"DATE\"\n },\n {\n \"name\":\"revenue\",\n \"dataType\":\"CURRENCY\"\n }\n]", "language": "json" } ] } [/block] The possible values for dataType are: `STRING`, `INTEGER`, `PERCENT`, `TIME`, `DATE`, `CURRENCY`, `FLOAT`. Map the enumerative indexes for each daily performance array row to the `columnHeaders` index to define "2016-01-01" as `date` of the dataType `DATE`, and 3787.01 as `revenue` of the dataType `CURRENCY`. [block:code] { "codes": [ { "code": "\"revenue\":[\n [\n \"2016-01-01\",\n 3787.01\n ]\n]", "language": "json" } ] } [/block]

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}