Skip to main content
Use /reports for grouped performance, such as profit by country. Use /events for individual visits, conversions, and outgoing postback attempts.

Start with a focused performance report

This query returns daily results for one campaign. Replace YOUR_CAMPAIGN_ID with an ID from the campaign list, set the example dates to a period containing your traffic, and supply your API key through METRICANIC_API_KEY. Make the same substitutions in the event example below:
Read rows from data.rows. Each row uses the requested dimension and metric IDs as keys. Entity groups such as campaign and offer contain an object with id and display-name fields. Other groups, such as day or country, contain scalar values. An unassigned group can be null. Replace the dimensions with country,deviceType to compare countries and devices.

Define the report’s meaning

Dimensions group rows. Metrics supply the numbers for each group. Source parameters are token1 through token15 in REST report queries. Their business meaning comes from the campaign’s traffic source mapping. For example, if token3 means placement in your traffic source, group by token3 and filter to that source’s campaigns. See Metrics for metric definitions and Goals to choose which events count as conversions, revenue, or cost. Built-in percentage metrics are returned as ratios. An API roi value of 0.2 means 20%, and a report filter for ROI above 20% uses roi>0.2. A ratio without a valid denominator is null.

Fetch all report rows

Read rows from data.rows and paging information from data.meta. Increase offset by limit until you have fetched data.meta.totalRows. Keep the dates, filters, grouping, and sort order unchanged. Use totals=1 to include totals in data.meta.totals. Ratios in totals are calculated from the total amounts, so do not average the individual row ratios. See Query reports for available dimensions, metrics, filters, and limits.

Encode filters without changing their structure

Each expression is field plus an operator plus one or more values. Supported operators are =, !=, >, and <. A pipe separates alternative values within one expression. A comma separates expressions. For multiple filters, encode each complete expression separately, then join them with literal commas. For example:
Here, baseUrl is the API base URL and params contains your dates, timezone, dimensions, and metrics. Keep the separator commas outside the encoded expressions.

Inspect the conversion or postback

For one campaign’s custom events:
Choose type=visit, lpclick, event, or postback. Use postback to check outgoing delivery attempts and their responses. Events arrive newest first. Read data.meta.hasMore and pass data.meta.nextCursor back as cursor until hasMore is false. Keep the original query unchanged while paging. An empty page can still carry a continuation cursor, so do not stop based only on row count. Use idx to select Event IDs, such as idx=1,3. See List events for filters and response fields.

Match dates explicitly

Both endpoints require from and to. For full calendar days, use YYYY-MM-DD and an explicit timezone. The end date includes that day’s final moment. Choose UTC or a timezone offered by the report interface. Use date-only ranges to compare calendar days. For an exact UTC window across both endpoints, send UTC timestamps with timezone=UTC. Performance reports attribute outcomes to the visit’s time. Event queries use each event’s occurrence time. A conversion received today for yesterday’s visit can therefore appear in yesterday’s performance report and today’s event results. For help comparing results, see Discrepancies.