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

# Compare Campaigns

> Compare campaign performance between two specified periods.
If previous dates are not provided, they are calculated based on the current period's duration.

Args:
    customer_id: The Google Ads customer ID
    current_start_date: Start date for the current period (YYYY-MM-DD). Defaults to 30 days ago.
    current_end_date: End date for the current period (YYYY-MM-DD). Defaults to today.
    previous_start_date: Optional start date for the previous period (YYYY-MM-DD).
    previous_end_date: Optional end date for the previous period (YYYY-MM-DD).
    campaigns: Optional list of campaign IDs (as strings) to compare.
    exclude_removed: Exclude REMOVED entities from results (default: False)
    oauth2_token: OAuth2 token for authentication

Returns:
    Campaign performance comparison data.



## OpenAPI

````yaml https://dev-api.cattix.com/openapi.json get /api/v1/google-ads/campaigns/compare
openapi: 3.1.0
info:
  title: CATTIX API
  description: CATTIX Backend API
  version: 0.107.0
servers:
  - url: http://localhost:8000
    description: Local
  - url: https://dev-api.cattix.com
    description: Development
  - url: https://staging-api.cattix.com
    description: Staging
  - url: https://api.cattix.com
    description: Production
security: []
paths:
  /api/v1/google-ads/campaigns/compare:
    get:
      tags:
        - Google Ads
      summary: Compare Campaigns
      description: >-
        Compare campaign performance between two specified periods.

        If previous dates are not provided, they are calculated based on the
        current period's duration.


        Args:
            customer_id: The Google Ads customer ID
            current_start_date: Start date for the current period (YYYY-MM-DD). Defaults to 30 days ago.
            current_end_date: End date for the current period (YYYY-MM-DD). Defaults to today.
            previous_start_date: Optional start date for the previous period (YYYY-MM-DD).
            previous_end_date: Optional end date for the previous period (YYYY-MM-DD).
            campaigns: Optional list of campaign IDs (as strings) to compare.
            exclude_removed: Exclude REMOVED entities from results (default: False)
            oauth2_token: OAuth2 token for authentication

        Returns:
            Campaign performance comparison data.
      operationId: compare_campaigns_api_v1_google_ads_campaigns_compare_get
      parameters:
        - name: customer_id
          in: query
          required: true
          schema:
            type: integer
            title: Customer Id
        - name: current_start_date
          in: query
          required: false
          schema:
            type: string
            title: Current Start Date
        - name: current_end_date
          in: query
          required: false
          schema:
            type: string
            title: Current End Date
        - name: previous_start_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Previous Start Date
        - name: previous_end_date
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Previous End Date
        - name: campaigns
          in: query
          required: false
          schema:
            anyOf:
              - items:
                  type: string
                type: array
              - type: 'null'
            title: Campaigns
        - name: exclude_removed
          in: query
          required: false
          schema:
            type: boolean
            default: false
            title: Exclude Removed
        - name: token_id
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            description: Optional specific Token ID
            title: Token Id
          description: Optional specific Token ID
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CampaignComparisonResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      deprecated: true
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    CampaignComparisonResponse:
      properties:
        comparisons:
          items:
            $ref: '#/components/schemas/CampaignComparisonData'
          type: array
          title: Comparisons
        current_period_start:
          type: string
          title: Current Period Start
        current_period_end:
          type: string
          title: Current Period End
        previous_period_start:
          type: string
          title: Previous Period Start
        previous_period_end:
          type: string
          title: Previous Period End
      type: object
      required:
        - comparisons
        - current_period_start
        - current_period_end
        - previous_period_start
        - previous_period_end
      title: CampaignComparisonResponse
      description: Response schema for campaign comparison
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CampaignComparisonData:
      properties:
        campaign_id:
          type: string
          title: Campaign Id
        campaign_name:
          type: string
          title: Campaign Name
        current_period:
          additionalProperties:
            type: number
          type: object
          title: Current Period
        previous_period:
          additionalProperties:
            type: number
          type: object
          title: Previous Period
        change_percentage:
          additionalProperties:
            type: number
          type: object
          title: Change Percentage
      type: object
      required:
        - campaign_id
        - campaign_name
        - current_period
        - previous_period
        - change_percentage
      title: CampaignComparisonData
      description: Schema for campaign comparison data
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: api/v1/users/authorization/token

````