Welcome to the Metrics API documentation. This guide will help you understand how to use our Metrics API to download your campaign data in a convenient CSV format. Below, you will find detailed instructions, data structure information, and examples to get you started.
Scope
The Metrics API allows you to download metrics from your campaigns. It will only provide data for the last 14 months.
Data Structure
The data downloaded from the Metrics API will be in a CSV file containing the following columns:
date: The date of the data entry.campaign_name: The name of the campaign.campaign_id: The unique identifier for the campaign. This value remains constant even if you change the name of the campaign.clicks: The number of paid clicks received.conversions: The number of conversions achieved, as measured by the Thribee Tracking Pixel (if installed).cost: The total cost incurred.cpc: Cost per click.conversion_rate: The rate of conversions relative to clicks, as measured by the Thribee Tracking Pixel (if installed).cpa: Cost per acquisition, as measured by the Thribee Tracking Pixel (if installed).
Authentication
Each source is assigned a unique API token. To download data for a specific source, you must use the corresponding API token in your API call. If you need to download data for multiple sources, you must generate and use a separate API token for each source.
The API token is managed through the Metrics API configuration page, where you can generate, copy, rotate (change) or cancel your API token.
API Endpoint
All API calls to retrieve campaign metrics data should be made to the following endpoint:
https://api.thribee.com/campaign/metrics?apiToken=validApiToken
Replace validApiToken with the actual API token assigned to the source you are querying.
Default Data Retrieval Period
By default, the Metrics API will return data for the last 12 months. You can use this default setting by simply providing your API token.
Optional Date Parameters
You can refine your data retrieval by specifying a start date and/or an end date. The dates must be in the yyyy-mm-dd format. Here are the optional parameters you can use:
startDate: The start date for the data retrieval period.endDate: The end date for the data retrieval period.
Summary of API Parameters
apiToken(required): The token for the specific source.startDate(optional): The start date for the data retrieval inyyyy-mm-ddformat.endDate(optional): The end date for the data retrieval inyyyy-mm-ddformat.
Full Example Calls
-
Default Last 12 Months Data
https://api.thribee.com/campaign/metrics?apiToken=validApiToken -
Data from August 1st, 2024, to Today
https://api.thribee.com/campaign/metrics?apiToken=validApiToken&startDate=2024-08-01 -
Data from August 1st, 2024, to March 8th, 2024
https://api.thribee.com/campaign/metrics?apiToken=validApiToken&startDate=2024-08-01&endDate=2024-03-08
Downloading the Data
The data will be downloaded as a CSV file, which can be easily imported into various analytics and reporting tools for further analysis.
Support
If you encounter any issues or have questions about using the Metrics API, please contact your Country Manager for assistance.
Comments
0 comments
Please sign in to leave a comment.