Skip to main content
Skip table of contents

Reporting API Reference

The APIs let you programmatically request reports from Atrilyx, for one or several websites and for any given date and period and in any format (CSV, JSON, XML, etc.).

URL

The API follows REST conventions. Perform an HTTPS GET to the URL with the format in which you'd like to receive data. The base URL is https://dashboard.atrilyx.com/index.php?module=API&idSite=33 where 33 is your client id.

The following response formats are supported.

Format

Description

Parameter

csv

Comma-separated values. Returns a file download.

&format=csv

tsv

Tab-separated values, similar to CSV but loads properly in Excel. Returns a file download.

&format=tsv

xml

Data is returned in the XML data format. Rendered through Matomo standard API response.

&format=xml

json

Data is returned in JSON format. Rendered through Matomo standard API response.

&format=json

html

Data is returned as an HTML table. Rendered through Matomo standard API response.

&format=html

Note: CSV and TSV formats return a file download (Content-Disposition: attachment). JSON, XML, and HTML are rendered through Matomo's standard API response handler.

Required API Parameters

  • idSite — The integer ID for your account. This can be found in the URL of your Atrilyx dashboard.

  • method — The report you would like to receive. Available reports are:

    • AtrilyxAPI.getCampaign — your network campaign report

    • AtrilyxAPI.getAdGroup — your ad group / ad set report

    • AtrilyxAPI.getAd — your ad report

  • startDate — The start date for the report. Format is yyyy-mm-dd (e.g., 2023-01-01).

  • endDate — The end date for the report. Format is yyyy-mm-dd (e.g., 2023-12-31).

  • token_auth — Your API Key.

Example

CODE
https://dashboard.atrilyx.com/index.php?module=API&method=AtrilyxAPI.getAd&startDate=2023-04-15&endDate=2023-04-30&idSite=33&format=html&token_auth=XXXXXXXXXXX

This returns a report with the default columns for the selected method. All data is aggregated by the attributes returned.

Default Columns Per Method

Each method returns a different set of default attributes and metrics when no attributes or metrics parameters are specified.

getCampaign Defaults

Attributes: program, network, campaign, campaign_type, campaign_id

Metrics: spend*, impressions, clicks, conversions, revenue, network_conversions, network_revenue, page_views, visits, utm_campaign_name

* spend appears as program_spend in output.

getAdGroup Defaults

Attributes: program, network, campaign, campaign_type, ad_group

Metrics: spend*, impressions, clicks, conversions, revenue, network_conversions, network_revenue, page_views, visits

* spend appears as program_spend in output.

getAd Defaults

Attributes: program, network, campaign, campaign_type, ad_group, ad

Metrics: spend*, impressions, clicks, conversions, revenue, network_conversions, network_revenue, page_views, visits

* spend appears as program_spend in output.

Spend column naming: When requesting spend as a metric, the output column will be labeled program_spend. This applies to all response formats.

Optional API Parameters

Attributes

Attributes determine what data points you would like to get a report on. They can be broken into two categories:

  • Dates: The following date types are accepted: date (data by day), week, and month.

  • Fields: See Attributes and Metrics for a list of fields supported by the API.

You can mix and match your attributes using a comma. For example:

  • Adding &attributes=month returns all default columns with data broken out by month.

  • Adding &attributes=ad returns only the ad attribute column with default metrics.

  • Combining: &attributes=ad,month returns ad performance by month with all default metrics.

Temporal attribute behavior: When a temporal attribute (date, month, or week) is the only attribute specified, entity-level attributes are automatically included. For example, &attributes=date on getCampaign returns date + program + network + campaign + campaign_type columns. On getAdGroup, it would also include ad_group. On getAd, it would also include ad_group + ad.

Metrics

Metrics are the results of your requested attributes. See Attributes and Metrics for a complete list.

  • Metrics are selected by passing the &metrics= parameter. For example, &metrics=spend returns all selected attributes with one metric column of spend.

  • Metrics can be mixed and matched: &metrics=spend,visits returns those two metric columns.

  • Combining attributes and metrics lets you structure your report exactly as needed: &attributes=ad,month&metrics=spend,visits

Filter Parameters

The following filter parameters can be appended to any API request to narrow the results:

Parameter

Type

Default

Description

includeOrganic

int

1

Include organic (non-paid) data. Set to 0 to exclude.

goal

string

""

Filter by goal.

conversionTime

string

""

Conversion time window.

campaign

string

""

Filter results to a specific campaign name.

campaignType

string

""

Filter by campaign type.

utmCampaign

string

""

Filter by UTM campaign parameter.

utmMedium

string

""

Filter by UTM medium parameter.

utmSource

string

""

Filter by UTM source parameter.

platform

string

""

Filter by network/platform name.

programType

string

""

Filter by program type.

Filter Example

CODE
&platform=Google&includeOrganic=0

This returns only Google paid data, excluding organic results.

Data Aggregation

  • Results are grouped by the selected attributes.

  • Numeric metrics are summed within each group.

  • Spend values are rounded to 2 decimal places.

Error Responses

If authentication fails or an error occurs, the API returns JSON error objects:

Authentication error:

JSON
{"error": "You can't access this resource as it requires 'view' access for the website id = X."}

General error:

JSON
{"error": true, "message": "API Error: <details>"}
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.