Skip to main content
Version: 26.01

Attribution - Campaign Data Read

Enterprise

This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.

Endpoint​

/o?method=campaigndata

Overview​

Returns time-series data of one campaign for the requested period.

Authentication​

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions​

  • Attribution Read permission for the target app.

Request Parameters​

ParameterTypeRequiredDescription
methodStringYesMust be campaigndata.
api_keyStringYes (or use auth_token)Dashboard API key.
auth_tokenStringYes (or use api_key)Dashboard auth token.
app_idStringYesTarget app ID.
campaign_idStringYesCampaign ID. The organic campaign ID is accepted as well.
periodString or ArrayNoPeriod of the returned data.

Examples​

Read campaign data for 30 days​

/o?method=campaigndata&api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2&campaign_id=campaign-summer-2026&period=30days

Response​

Success Response​

The time-series data of the campaign is returned as a JSON object, with the number of unique clicks (clk) used as the unique metric. If the campaign does not belong to the app, an empty object is returned.

{}

Behavior​

  • The campaign must belong to the app given in app_id; otherwise an empty object is returned.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.campaignsCampaign ownership checkReads the campaign by ID and app.
countly.campaigndataTime-series dataReads campaign metrics.