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

# Scan Google Ads conversion tracking

> <Info>This API is in beta. Endpoints, fields, and behavior may still change, so avoid depending on it in production.</Info>

Cross-references the app's conversion mappings against the conversion calls in its code, and reports what does not line up.

Each entry in `gaps` names one problem. An `error` is a mapped conversion that cannot fire, and a `warning` is a setup that works but probably is not what you meant, such as a disabled mapping or code firing a goal no mapping points at. A `missing-call-` gap also carries a `composer_prompt` you can hand to [Send chat message](/api-reference/send-chat-message) to have the AI write the fix.

<Note>For apps built in the current editor the scan reads the published version of the app, so a call you have written but not published yet still shows as a `missing-call-` gap. Publish the app, then scan again.</Note>

<Warning>`is_clean` is `true` when nothing was scanned, so read `skipped_reason` first. An app with no Google Ads account comes back with `is_clean` set to `true`, no `gaps`, and `skipped_reason` set to `no_google_ads_account`, which is not a clean bill of health. That response also omits `enabled_mappings_count`.</Warning>

<Note>This endpoint accepts a personal API key or a workspace API key. A workspace API key acts as the workspace owner.</Note>

<Warning>The response includes fields beyond the ones documented here. Don't rely on undocumented response fields, as they can change at any time.</Warning>



## OpenAPI

````yaml /developers/references/app-management/app-management-openapi.json get /api/apps/{app_id}/google-ads/tracking-scan
openapi: 3.1.0
info:
  title: Base44 App Management API
  version: 1.0.0
servers:
  - url: https://app.base44.com
security:
  - PersonalAccessTokenAuth: []
paths:
  /api/apps/{app_id}/google-ads/tracking-scan:
    get:
      summary: Scan Google Ads conversion tracking
      description: >-
        <Info>This API is in beta. Endpoints, fields, and behavior may still
        change, so avoid depending on it in production.</Info>


        Cross-references the app's conversion mappings against the conversion
        calls in its code, and reports what does not line up.


        Each entry in `gaps` names one problem. An `error` is a mapped
        conversion that cannot fire, and a `warning` is a setup that works but
        probably is not what you meant, such as a disabled mapping or code
        firing a goal no mapping points at. A `missing-call-` gap also carries a
        `composer_prompt` you can hand to [Send chat
        message](/api-reference/send-chat-message) to have the AI write the fix.


        <Note>For apps built in the current editor the scan reads the published
        version of the app, so a call you have written but not published yet
        still shows as a `missing-call-` gap. Publish the app, then scan
        again.</Note>


        <Warning>`is_clean` is `true` when nothing was scanned, so read
        `skipped_reason` first. An app with no Google Ads account comes back
        with `is_clean` set to `true`, no `gaps`, and `skipped_reason` set to
        `no_google_ads_account`, which is not a clean bill of health. That
        response also omits `enabled_mappings_count`.</Warning>


        <Note>This endpoint accepts a personal API key or a workspace API key. A
        workspace API key acts as the workspace owner.</Note>


        <Warning>The response includes fields beyond the ones documented here.
        Don't rely on undocumented response fields, as they can change at any
        time.</Warning>
      operationId: scan_tracking_api_apps__app_id__google_ads_tracking_scan_get
      parameters:
        - name: app_id
          in: path
          required: true
          schema:
            type: string
            description: >-
              ID of the app whose Google Ads conversion tracking you want to
              manage.
            title: App Id
          description: >-
            ID of the app whose Google Ads conversion tracking you want to
            manage.
          example: 6820f3a4e7b91d003c45a1f2
      responses:
        '200':
          description: What the scan found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrackingScanResult'
        '401':
          description: Missing or invalid credentials.
        '403':
          description: >-
            You don't have access to this app or the app does not exist. A
            missing app and an app you cannot reach are deliberately the same
            answer. Marketing setup, campaign edits, generation and resuming
            also return `app_marketing_not_allowed` when the app's owning
            workspace has the FERPA designation. Historical reads, pausing,
            deletion and financial settlement remain available.
        '429':
          description: >-
            `rate_limited`: The base limit is 1,200 requests in a minute from
            your account, shared across every Google Ads read that doesn't name
            its own limit. Some workspaces have a higher limit.
            `X-RateLimit-Limit` reports the enforced limit. Retry after
            `Retry-After` seconds. The `X-RateLimit-*` headers report the budget
            left.
          content:
            application/json:
              examples:
                rate_limited:
                  summary: rate_limited
                  value:
                    error:
                      code: rate_limited
                      message: Rate limit exceeded.
                      details: {}
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
        '503':
          description: >-
            Database temporarily unavailable (`database_unavailable`): the data
            cluster did not answer in time. Retry after the `Retry-After`
            seconds.
          headers:
            Retry-After:
              description: Seconds to wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StandardErrorEnvelope'
              examples:
                database_unavailable:
                  summary: database_unavailable
                  value:
                    error:
                      code: database_unavailable
                      message: Database temporarily unavailable, please retry
                      details: {}
      security:
        - PersonalAccessTokenAuth:
            - read_only
        - WorkspaceApiKeyAuth:
            - read_only
        - WorkspaceApiKeyBearerAuth:
            - read_only
components:
  schemas:
    TrackingScanResult:
      properties:
        gaps:
          items:
            $ref: '#/components/schemas/TrackingGap'
          type: array
          title: Gaps
          description: >-
            Everything the scan flagged. Empty when it found nothing and when it
            did not run, which `skipped_reason` tells apart.
          example: []
        mappings_count:
          type: integer
          title: Mappings Count
          description: How many conversion mappings the account has, enabled or not.
          example: 3
        calls_count:
          type: integer
          title: Calls Count
          description: >-
            How many gtag conversion calls with a literal `send_to` the scan
            found in the app's code.
          example: 0
        is_clean:
          type: boolean
          title: Is Clean
          description: >-
            Whether the scan flagged no error-severity gap (`true`) or at least
            one (`false`). It also reads `true` when the scan did not run at
            all, so check `skipped_reason` first.
          example: false
        enabled_mappings_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Enabled Mappings Count
          description: >-
            How many of the mappings are enabled. Absent when `skipped_reason`
            is set.
          example: 2
        skipped_reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Skipped Reason
          description: >-
            Why nothing was scanned. The value is `no_google_ads_account` when
            the app has no active Google Ads account, `app_not_found`, or
            `app_code_unreadable` when the app's code is only readable from its
            published version and Base44 could not read one, for example because
            the app was never published. The field is absent whenever a scan
            ran.
          example: no_google_ads_account
      type: object
      required:
        - gaps
        - mappings_count
        - calls_count
        - is_clean
      title: TrackingScanResult
      description: What the conversion-tracking scan found.
    StandardErrorEnvelope:
      properties:
        error:
          $ref: '#/components/schemas/StandardError'
          description: What went wrong.
      type: object
      required:
        - error
      title: StandardErrorEnvelope
      description: The error body returned in the standard envelope.
    TrackingGap:
      properties:
        id:
          type: string
          title: Id
          description: >-
            Identifier for this gap within the scan. A gap whose ID starts with
            `missing-call-` is a mapped goal with no firing code, `no-action-`
            is a mapping with no matching goal in Google Ads, `disabled-` is a
            disabled mapping, and `orphan-call-` is code firing a conversion no
            mapping points at.
          example: missing-call-68b1c0d4e7b91d003c45a1f7
        severity:
          type: string
          title: Severity
          description: >-
            How serious the gap is. `error` means a mapped conversion cannot
            fire, and `warning` means the setup works but something is
            configured in a way you probably did not intend.
          example: error
        message:
          type: string
          title: Message
          description: >-
            What is wrong, written for an engineer. It names the `send_to` and
            the call shape where those apply.
          example: >-
            Order.create is mapped to PURCHASE but no gtag('event',
            'conversion', { send_to: 'AW-123456789/AbCdEfGhIj', ... }) call
            exists in the app code.
        suggested_files:
          items:
            type: string
          type: array
          title: Suggested Files
          description: >-
            Up to three files in the app that look like the place to add or fix
            the call. Empty when the scan has no suggestion.
          example:
            - src/pages/Checkout.jsx
        composer_prompt:
          type: string
          title: Composer Prompt
          description: >-
            An instruction you can send to [Send chat
            message](/api-reference/send-chat-message) to have the AI fix this
            gap. Only a `missing-call-` gap carries one; it is an empty string
            on every other kind.
          example: Add a Google Ads conversion call to the order confirmation flow.
        mapping_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Mapping Id
          description: >-
            The conversion mapping this gap is about. Absent on an
            `orphan-call-` gap, which is about code rather than a mapping.
          example: 68b1c0d4e7b91d003c45a1f7
        conversion_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Conversion Type
          description: >-
            Conversion category the mapping names, such as `PURCHASE`. Absent on
            an `orphan-call-` gap.
          example: PURCHASE
        entity_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Entity Name
          description: >-
            App entity the mapping is tied to. Absent on a `disabled-` or
            `orphan-call-` gap, and empty on a mapping with no entity.
          example: Order
        trigger_action:
          anyOf:
            - type: string
            - type: 'null'
          title: Trigger Action
          description: >-
            Which write on the entity the mapping covers. Absent on a
            `disabled-` or `orphan-call-` gap.
          example: create
        send_to:
          anyOf:
            - type: string
            - type: 'null'
          title: Send To
          description: >-
            The gtag `send_to` value the code should fire. Present only on a
            `missing-call-` gap, which is the only kind that has resolved one.
          example: AW-123456789/AbCdEfGhIj
        display_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Display Message
          description: >-
            The same problem in plain language, safe to show someone. Present
            only on a `missing-call-` gap.
          example: >-
            Your Purchase conversion is not being recorded when an order is
            created.
      type: object
      required:
        - id
        - severity
        - message
        - suggested_files
        - composer_prompt
      title: TrackingGap
      description: One problem the tracking scan found.
    StandardError:
      properties:
        code:
          type: string
          title: Code
          description: >-
            Stable machine-readable cause of the failure. Match on this, not on
            `message`.
          example: not_found
        message:
          type: string
          title: Message
          description: Human-readable explanation. It isn't a stable contract.
          example: App not found
        details:
          additionalProperties: true
          type: object
          title: Details
          description: >-
            Structured context for the failure, or an empty object when there's
            none.
          example: {}
      type: object
      required:
        - code
        - message
      title: StandardError
  securitySchemes:
    PersonalAccessTokenAuth:
      type: http
      scheme: bearer
      description: >-
        Personal access token, sent as `Authorization: Bearer <token>`. Each
        operation lists the permission it needs: `read_only` or `full_access`. A
        full-access token can call every operation. A read-only token can call
        only the operations that list `read_only`; anything else returns 403
        `read_only_credential_route_not_allowed`.
    WorkspaceApiKeyAuth:
      type: apiKey
      in: header
      name: api_key
      description: >-
        Workspace API key, sent as `api_key: <key>`. Each operation that accepts
        one lists what the key needs: a permission, `read_only` or
        `full_access`, like a personal access token, or a scope. A key without
        the scope gets 403 `workspace_api_key_scope_required`.
    WorkspaceApiKeyBearerAuth:
      type: http
      scheme: bearer
      description: >-
        Workspace API key, sent as `Authorization: Bearer <key>`. Accepted
        wherever `api_key` is, with the same permission.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.