Skip to main content
Version: 24.05

Campaign Data

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 the time-series data of one campaign for a period.

Authentication​

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

Permissions​

  • Requires Read permission for the Attribution feature in the target app.

Request Parameters​

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key authentication
auth_tokenStringYes (or api_key)Auth token authentication
app_idStringYesID of the app the campaign belongs to.
methodStringYesMust be campaigndata.
campaign_idStringYesCampaign ID. Use [CLY]_organic for organic traffic of the app.
periodStringNoStandard Countly period value, for example 30days.

Examples​

Example 1: Read campaign data​

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

Example 2: Read organic data​

/o?method=campaigndata&
api_key=YOUR_API_KEY&
app_id=6991c75b024cb89cdc04efd2&
campaign_id=[CLY]_organic&
period=30days

Response​

Success Response​

The response is the campaign's time-series object for the period, with the click counts of the campaign by date and its segment breakdowns.

Response Fields​

FieldTypeDescription
(root object)ObjectTime-series data of the campaign. An empty object when the campaign does not exist in the app.

Behavior​

  • A campaign that does not belong to the app in app_id returns an empty object.
  • The organic campaign ([CLY]_organic) is always read for the app in app_id.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.campaignsCampaign definitionsChecks that the campaign belongs to the app.
countly.campaigndataTime-series campaign metricsSource of the returned data.