> ## Documentation Index
> Fetch the complete documentation index at: https://docs.adside.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Attribution Data

> Retrieve attribution data with conversion tracking across multiple attribution windows (1-day click, 7-day click, 1-day view). Returns conversion metrics and cost-per-conversion analysis.

Rows are heavy: every row carries `actions` and `cost_per_action_type`, each entry split across three attribution windows. The response is capped in size — past that, rows are dropped and a `truncation` object says how many, and those rows are an arbitrary page rather than the top ones, because this endpoint returns no ranking. `summary` is always computed over every fetched row. Narrow the call (`limit`, a single `object_id`) rather than relying on the cap, and use the reporting-warehouse tools to rank objects over a period.



## OpenAPI

````yaml /api-reference/openapi.yaml post /meta/mcp#get_attribution_data
openapi: 3.1.0
info:
  title: Multi-Source Ads API
  version: 1.0.0
  description: >-
    Unified API for managing ad campaigns across Meta, LinkedIn, and Google. MCP
    tools are accessed via JSON-RPC 2.0 over HTTP (`POST /{source}/mcp`). Google
    Sheets/Drive endpoints use standard REST.
servers:
  - url: https://api.adside.ai
    description: Production
  - url: http://localhost:3100
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Accounts
    description: ''
  - name: Ads
    description: ''
  - name: Analytics
    description: ''
  - name: Asset Groups
    description: ''
  - name: Assets
    description: ''
  - name: Audiences
    description: ''
  - name: Campaign Groups
    description: ''
  - name: Campaigns
    description: ''
  - name: Conversions
    description: ''
  - name: Creatives
    description: ''
  - name: Drive
    description: ''
  - name: Google
    description: ''
  - name: Google Ads
    description: ''
  - name: Google Tag Manager
    description: ''
  - name: Keywords
    description: ''
  - name: Linkedin
    description: ''
  - name: Meta
    description: ''
  - name: Meta Reporting
    description: ''
  - name: OAuth
    description: ''
  - name: Other
    description: ''
  - name: Reports
    description: ''
  - name: Sheets
    description: ''
  - name: Targeting
    description: ''
  - name: Tiktok
    description: ''
  - name: Workspace
    description: ''
paths:
  /meta/mcp#get_attribution_data:
    post:
      tags:
        - Meta
        - Other
      summary: Get Attribution Data
      description: >-
        Retrieve attribution data with conversion tracking across multiple
        attribution windows (1-day click, 7-day click, 1-day view). Returns
        conversion metrics and cost-per-conversion analysis.


        Rows are heavy: every row carries `actions` and `cost_per_action_type`,
        each entry split across three attribution windows. The response is
        capped in size — past that, rows are dropped and a `truncation` object
        says how many, and those rows are an arbitrary page rather than the top
        ones, because this endpoint returns no ranking. `summary` is always
        computed over every fetched row. Narrow the call (`limit`, a single
        `object_id`) rather than relying on the cap, and use the
        reporting-warehouse tools to rank objects over a period.
      operationId: meta_get_attribution_data
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  const: '2.0'
                id:
                  type: string
                  example: '1'
                method:
                  type: string
                  const: tools/call
                params:
                  type: object
                  required:
                    - name
                    - arguments
                  properties:
                    name:
                      type: string
                      const: get_attribution_data
                    arguments:
                      $ref: '#/components/schemas/meta_get_attribution_data_input'
      responses:
        '200':
          description: JSON-RPC response with tool result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpToolResponse'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Channel not connected or access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    meta_get_attribution_data_input:
      type: object
      properties:
        object_id:
          description: >-
            ID of the object to get insights for. Omit it to use the connected
            ad account (recommended for account-wide queries at any level).
            Otherwise pass a campaign ID, ad set ID, or ad ID matching `level`.
            Account IDs other than the connected account are rejected. Passing a
            page/business/user ID returns Meta error #100.
          type: string
        level:
          type: string
          enum:
            - account
            - campaign
            - adset
            - ad
          description: Level of insights to retrieve
        date_preset:
          description: Date preset for insights
          type: string
          enum:
            - today
            - yesterday
            - last_3d
            - last_7d
            - last_14d
            - last_28d
            - last_30d
            - last_90d
            - this_week_mon_today
            - this_week_sun_today
            - last_week_mon_sun
            - last_week_sun_sat
            - this_month
            - last_month
            - this_quarter
            - last_quarter
            - this_year
            - last_year
            - maximum
            - data_maximum
        time_range:
          description: Custom date range for insights
          type: object
          properties:
            since:
              type: string
              pattern: ^\d{4}-\d{2}-\d{2}$
              description: Start date (YYYY-MM-DD)
            until:
              type: string
              pattern: ^\d{4}-\d{2}-\d{2}$
              description: End date (YYYY-MM-DD)
          required:
            - since
            - until
        fields:
          description: Specific fields to retrieve (e.g., impressions, clicks, spend)
          type: array
          items:
            type: string
        breakdowns:
          description: Breakdown dimensions (e.g., age, gender, placement)
          type: array
          items:
            type: string
        time_increment:
          description: >-
            Time granularity: "monthly" for monthly rows, "all_days" for daily
            rows, or a number 1-90 for N-day increments
          anyOf:
            - type: string
              enum:
                - monthly
                - all_days
            - type: integer
              minimum: 1
              maximum: 90
        limit:
          default: 25
          description: Number of insights to return
          type: number
          minimum: 1
          maximum: 100
      required:
        - level
      $schema: http://json-schema.org/draft-07/schema#
    McpToolResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          const: '2.0'
        id:
          type: string
        result:
          type: object
          properties:
            content:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: text
                  text:
                    type: string
                    description: JSON-stringified tool result
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
        code:
          type: string
          enum:
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - RATE_LIMITED
            - INTERNAL_ERROR
          description: Error code
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key (sk_live_*) — SHA256 hashed, looked up in Redis. Generate via
        the web app's workspace settings.

````