GET /admin/utmStats  API documentation

Get the UTM parameter statistics reports (similar to the UTM analysis in the admin dashboard). This endpoint allows you to analyze performance by different UTM parameters like source, medium, campaign, term, or content.

GET https://demo.trafficmanager.com/api/v1/admin/utmStats/{startTime}/{endTime}/{utm}/

Authentication:

The request must be authenticated with the following HTTP headers:
  • x-api-key: Your API key, found in the Security page
  • x-user-id: Your User ID, found in the Security page
If the HTTP headers are not passed, but you are logged in to the TrafficManager panel, the current user is used instead (so you can easily preview or download the data using your browser)

GET Parameters:

  • Required:
  • startTime: Start time. Unix timestamp or any value accepted by strtotime. For example: 2023-01-01, today, -10 minutes...
  • endTime: End time. Unix timestamp or any value accepted by strtotime. For example: 2023-01-01 23:59:59, today 23:59:59, -5 minutes...
  • utm: UTM parameter to analyze. Allowed values are:
    • utm_sources - analyze by traffic source
    • utm_mediums - analyze by marketing medium
    • utm_campaigns - analyze by campaign name
    • utm_terms - analyze by campaign terms/keywords
    • utm_contents - analyze by ad content/creative
  • Optional:
  • user_id: affiliate ID filter (if set, returns only the data for that affiliate)
  • offer_id: offer ID filter (if set, returns only the data for that offer)
  • totals: set to any value to include totals in the response

Returned values:

  • The response is a JSON where every row has the following data:
  • Date
  • UTM parameter value (source, medium, campaign, term, or content depending on the {utm} parameter)
  • Number of impressions
  • Number of clicks
  • Number of unique clicks
  • Number of leads
  • Number of conversions
  • Conversion rate (conversions/clicks * 100)
  • EPC (average payout per n clicks, calculated as: payout/clicks*n, where n is the EPC factor, currently 100)
  • Unique EPC (average payout per n unique clicks)
  • Total payout to the affiliate

If totals parameter is included, the response will also contain a totals object with aggregated values across all rows.

Request examples

GET https://demo.trafficmanager.com/api/v1/admin/utmStats/2025-07-31/2025-08-07/utm_sources/
GET https://demo.trafficmanager.com/api/v1/admin/utmStats/2025-07-31/2025-08-07/utm_campaigns/?totals=1&user_id=123

Response example

{
    "data": [
        {
            "date": "2025-08-01",
            "utm_source": "google",
            "impressions": 1250,
            "clicks": 87,
            "unique_clicks": 74,
            "leads": 12,
            "conversions": 5,
            "conv_rate": 5.7,
            "epc": 3.45,
            "unique_epc": 4.05,
            "payout": 30.00        },
        {
            "date": "2025-08-07",
            "utm_source": "facebook",
            "impressions": 890,
            "clicks": 45,
            "unique_clicks": 41,
            "leads": 8,
            "conversions": 3,
            "conv_rate": 6.7,
            "epc": 4.44,
            "unique_epc": 4.88,
            "payout": 20.00        }
    ],
    "totals": {
        "impressions": 2140,
        "clicks": 132,
        "unique_clicks": 115,
        "leads": 20,
        "conversions": 8,
        "conv_rate": 6.1,
        "epc": 3.79,
        "unique_epc": 4.35,
        "payout": 50.00    },
    "status": 200
}
    

Error responses

  • 400 Bad Request: Invalid UTM parameter provided
  • 401 Unauthorized: Invalid or missing authentication
  • 403 Forbidden: User is not an admin
  • 500 Internal Server Error: Server error occurred
{
    "status": 400,
    "message": "Invalid UTM parameter. Allowed values are: utm_sources, utm_mediums, utm_campaigns, utm_terms, utm_contents"
}