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

# Get ad analytics

> Retrieve analytics for a single ad in a project.



## OpenAPI

````yaml get /projects/{project_id}/ads/{id}/analytics
openapi: 3.0.1
info:
  title: BeyondWords REST API
  description: |-
    This is the documentation for the BeyondWords REST API.
              You can use this API to use BeyondWords programmatically.
              You can get your API Key and Project ID for each project in the Project settings tab in the BeyondWords
              <a href="https://dash.beyondwords.io/dashboard">dashboard</a>.
  version: 1.0.0
servers:
  - url: https://api.beyondwords.io/v1
security: []
paths:
  /projects/{project_id}/ads/{id}/analytics:
    parameters:
      - name: project_id
        in: path
        description: The numeric ID of your project
        required: true
        schema:
          type: string
      - name: id
        in: path
        description: The ID of the ads campaign
        required: true
        schema:
          type: string
    get:
      tags:
        - Analytics
      summary: Ad analytics
      description: Retrieve analytics for a single ad in a project.
      operationId: ads#analytics
      parameters:
        - name: aggregation
          in: query
          schema:
            type: string
            enum:
              - all
              - hour
              - day
              - week
              - month
              - year
          required: false
          description: |2-

                      The way to aggregate the analytics. Possible values are all (aggregate all data together),
                      year (aggregate data on a yearly basis), month (aggregate data on a yearly basis),
                      week (aggregate data on a yearly basis), day (aggregate data on a yearly basis), or hour
                      (aggregate data on an hourly basis, limited to a time_range 7 days or less).
        - name: time_range[start]
          in: query
          required: false
          description: >-
            The start date of the aggregation period. The value of this property
            should be a string in
                      the format yyyy-mm-dd according to ISO 8601.
          schema:
            type: string
        - name: time_range[end]
          in: query
          required: false
          description: >-
            The end date of the aggregation period. The value of this property
            should be a string
                      in the format yyyy-mm-dd according to ISO 8601. If this is set to today, the current day is still
                      in progress and therefore only partial analytics data is returned until the day ends.
          schema:
            type: string
        - name: metrics[]
          in: query
          schema:
            type: array
            items:
              type: string
          required: false
          description: The metrics that you want to fetch data for
        - name: media_variants[]
          in: query
          schema:
            type: array
            items:
              type: string
              enum:
                - article
                - summary
          required: false
          description: The media variants to fetch data for
        - name: media_formats[]
          in: query
          schema:
            type: array
            items:
              type: string
              enum:
                - audio
                - video
          required: false
          description: The media formats to fetch data for
        - name: access_tiers[]
          in: query
          schema:
            type: array
            items:
              type: string
          required: false
          description: The access tiers to fetch data for
      responses:
        '200':
          description: OK
          content:
            application/json:
              examples:
                example:
                  $ref: '#/components/examples/analyticsCampaignExample'
              schema:
                $ref: '#/components/schemas/analyticsCampaignModel'
          headers:
            X-BeyondWords-Aggregation:
              description: Analytics aggregation
              schema:
                type: string
              required: false
            X-BeyondWords-Time-Range-Start:
              description: Analytics start time
              schema:
                type: string
              required: false
            X-BeyondWords-Time-Range-End:
              description: Analytics end time
              schema:
                type: string
              required: false
      security:
        - apiKey: []
components:
  examples:
    analyticsCampaignExample:
      summary: A sample ad analytics response
      value:
        id: 100
        title: Ad title,
        player_impressions:
          total: 5000
          desktop: 2000
          tablet: 1000
          mobile_web: 0
          ios: 1000
          andriod: 1000
  schemas:
    analyticsCampaignModel:
      type: object
      properties:
        id:
          type: integer
          description: Ad identifier
        title:
          type: integer
          description: Ad title (internal identifier)
        player_impressions:
          type: object
          properties:
            total:
              type: integer
              description: Total player loads associated with the ad
            desktop:
              type: integer
              description: Player loads on desktop devices
            tablet:
              type: integer
              description: Player loads on tablets
            mobile_web:
              type: integer
              description: Player loads on mobile web
            ios:
              type: integer
              description: Player loads on iOS devices
            android:
              type: integer
              description: Player loads on Android devices
        listens:
          type: object
          properties:
            total:
              type: integer
              description: Total plays associated with the ad
            desktop:
              type: integer
              description: Plays on desktop devices
            tablet:
              type: integer
              description: Plays on tablets
            mobile_web:
              type: integer
              description: Plays on mobile web
            ios:
              type: integer
              description: Plays on iOS devices
            android:
              type: integer
              description: Plays on Android devices
        completions:
          type: object
          properties:
            total:
              type: integer
              description: Completed plays (reached end) associated with the ad
            desktop:
              type: integer
            tablet:
              type: integer
            mobile_web:
              type: integer
            ios:
              type: integer
            android:
              type: integer
        completion_rate:
          type: object
          properties:
            total:
              type: integer
              description: Completion rate as a percentage (0–100)
            desktop:
              type: integer
            tablet:
              type: integer
            mobile_web:
              type: integer
            ios:
              type: integer
            android:
              type: integer
        clicks:
          type: object
          properties:
            total:
              type: integer
              description: Total ad click-throughs
            desktop:
              type: integer
            tablet:
              type: integer
            mobile_web:
              type: integer
            ios:
              type: integer
            android:
              type: integer
        click_rate:
          type: object
          properties:
            total:
              type: integer
              description: Click-through rate as a percentage (0–100)
            desktop:
              type: integer
            tablet:
              type: integer
            mobile_web:
              type: integer
            ios:
              type: integer
            android:
              type: integer
  securitySchemes:
    apiKey:
      type: apiKey
      name: X-Api-Key
      in: header

````