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

# Record Activity Log

> Records user activity logs for advertising optimization and analytics.

Supported activity types:
- `activity.item_view`: Records product detail page views
- `activity.add_cart`: Records cart addition events
- `activity.page_view`: Records page navigation events
- `activity.search`: Records search query events
- `activity.purchase`: Records completed purchases

Note: Returns 200 OK for all requests. Invalid schemas are silently ignored.



## OpenAPI

````yaml /openapi/adm.openapi.en-0.2.2.json post /dmp/v0/log/activity
openapi: 3.1.0
info:
  description: >
    ## Introduction

    The Data Management APIs comprehensively oversees the **diverse data** used
    by advertising and recommendation systems, ensuring that the Decision API
    runs accurately and efficiently.


    From registering, updating, and deleting campaigns and placements to **log
    and statistics analysis**, it provides the insights necessary for effective
    system operation.


    The resulting data and metrics are used by the Decision API to **optimize ad
    and content decisions**, ultimately boosting the overall performance of the
    advertising and recommendation system.
  title: Data Management APIs
  version: 0.1.3
servers: []
security: []
tags:
  - name: Audience Targeting
  - description: >

      The Audience Management APIs to seamlessly integrate Audience-related
      data.  


      References:

      - [First-Party
      Data](https://docs.aiderx.io/guides/about-a2/en/first-party-data)
    name: Audience
  - description: >
      APIs for collecting user activity data to enhance ad targeting and
      performance optimization.


      Activity Data captures actual user behavior data like product views,
      searches, cart additions, and purchases across all users, regardless of ad
      interactions.


      References:

      - [First-Party
      Data](https://docs.aiderx.io/guides/about-a2/en/first-party-data)
    name: Activity Log
  - description: >

      The Audience Attribute API provides access to audience attribute data.


      References:

      - [Audience
      Targeting](https://docs.aiderx.io/guides/about-a2/en/audience-targeting)
    name: Audience Attribute
  - description: >

      The Audience Segment API provides access to audience segment data.


      References:

      - [Audience
      Targeting](https://docs.aiderx.io/guides/about-a2/en/audience-targeting)
    name: Audience Segment
  - description: The Analytic API provides access to dashboard and A2 metric data.
    name: Analytic
  - description: >

      The Billing API manages billing information.

      A2 is configured to work with the payment systems used by your retail
      platform.


      To integrate payments, first you need to register an external channel.

      For more information about integrating A2 with external channels, check
      out [the External channels
      page](https://docs.aiderx.io/guides/about-a2/en/external-channel).
    name: Billing
  - description: |

      The Campaign API allows you to manage data related to campaigns.

      References:
      - [Campaign](https://docs.aiderx.io/guides/about-a2/en/campaign)
    name: Campaign
  - description: >

      The Creative API provides comprehensive functionalities for managing
      creative assets and related resources.


      References:

      - [Creative](https://docs.aiderx.io/guides/about-a2/en/creative)
    name: Creative
  - description: >

      The Allocation API provides comprehensive functionalities for managing
      allocation and related resources.


      References:

      - [Allocation](https://docs.aiderx.io/guides/about-a2/en/allocation)
    name: Allocation
  - description: >

      The Media Library API provides comprehensive functionalities for managing
      media library and related resources.


      References:

      - [Media Library](https://docs.aiderx.io/guides/about-a2/en/media-library)
    name: Media Library
  - description: >

      The Catalog Management API provides functionalities for managing catalogs
      and related resources.


      References:

      - [First-Party
      Data](https://docs.aiderx.io/guides/about-a2/en/first-party-data)
    name: Catalog
  - description: >

      The Placement Management API provides comprehensive functionalities for
      managing placements and related resources.


      References:

      - [Placement](https://docs.aiderx.io/guides/about-a2/en/placement)
    name: Placement
  - description: >

      Placement Catalog transforms the placement information into a structured
      “advertising product” that can be easily showcased to advertisers.


      References:

      - To be updated
    name: Placement Catalog
  - description: >

      The System APIs allow you to access and manage system-level settings and
      assets, such as logos and configuration values.


      References:

      - [Yield Optimization
      Settings](https://docs.aiderx.io/guides/about-a2/en/yield-optimization)
    name: System
  - description: >

      The Auth and User API provides authentication and user management
      functionalities.


      References:

      - [Account and
      Budget](https://docs.aiderx.io/guides/about-a2/en/account-and-budget)
    name: Auth and User
  - description: |

      The License API provides license management functionalities.
    name: License
paths:
  /dmp/v0/log/activity:
    post:
      tags:
        - Activity Log
      summary: Record Activity Log
      description: >-
        Records user activity logs for advertising optimization and analytics.


        Supported activity types:

        - `activity.item_view`: Records product detail page views

        - `activity.add_cart`: Records cart addition events

        - `activity.page_view`: Records page navigation events

        - `activity.search`: Records search query events

        - `activity.purchase`: Records completed purchases


        Note: Returns 200 OK for all requests. Invalid schemas are silently
        ignored.
      operationId: handle_activity_log_app_v0_log_activity_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ActivityLogSchema'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema: {}
          description: Successful Response
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
          description: Validation Error
components:
  schemas:
    ActivityLogSchema:
      properties:
        catalogs:
          description: >-
            List of catalogs associated with the activity. (for item_view,
            add_cart, page_view, purchase)
          items:
            $ref: '#/components/schemas/CatalogBaseSchema'
          title: Catalogs
          type: array
        channel:
          description: Channel through which the activity occurred
          title: Channel
          type: string
        device:
          anyOf:
            - $ref: '#/components/schemas/Device'
            - type: 'null'
          description: Optional AdCom v1.0 Device information
        device_id:
          description: Unique identifier for the device used
          title: Device Id
          type: string
        id:
          anyOf:
            - type: string
            - type: 'null'
          description: Unique identifier for the activity event
          title: Id
        page_id:
          anyOf:
            - type: string
            - type: 'null'
          description: Unique identifier for the specific page where the activity occurred
          title: Page Id
        query:
          anyOf:
            - type: string
            - type: 'null'
          description: Search query for search activities
          title: Query
        revenue:
          anyOf:
            - $ref: '#/components/schemas/Revenue'
            - type: 'null'
          description: Revenue generated from the purchase activity
        schema:
          description: The type of activity to record
          enum:
            - activity.item_view
            - activity.add_cart
            - activity.page_view
            - activity.search
            - activity.purchase
          title: Schema
          type: string
        timestamp:
          description: Unix timestamp when the activity occurred
          title: Timestamp
          type: integer
        user_id:
          description: Unique identifier for the user performing the activity
          title: User Id
          type: string
      required:
        - schema
        - timestamp
        - channel
        - user_id
        - device_id
        - catalogs
        - query
        - revenue
      title: ActivityLogSchema
      type: object
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          title: Detail
          type: array
      title: HTTPValidationError
      type: object
    CatalogBaseSchema:
      description: >-
        Base schema for catalog entries.


        Provides core structure for catalog items including schema
        identification

        and metadata validation.
      properties:
        id:
          default: ''
          description: The ID of catalog item
          title: Id
          type: string
        metadata:
          $ref: '#/components/schemas/CatalogMetadataSchema'
          description: >
            The metadata of catalog item.


            The schema defined by `schema` field specifies the minimum required
            fields.

            Additional fields beyond the schema definition are allowed and will
            be preserved.
        schema:
          const: creative.catalog
          default: creative.catalog
          description: |-
            The schema of catalog item.

            Supported schema:
              - `creative.catalog`: `CatalogMetadataSchema`
                    
          title: Schema
          type: string
        source:
          anyOf:
            - type: string
            - type: 'null'
          description: The source of catalog item
          title: Source
      required:
        - metadata
      title: CatalogBaseSchema
      type: object
    Device:
      properties:
        carrier:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Carrier or ISP (e.g., “VERIZON”) using exchange curated string names
            which should be published to bidders a priori.
          title: Carrier
        contype:
          anyOf:
            - $ref: '#/components/schemas/ConnectionType'
            - type: 'null'
          description: >-
            Network connection type. Refer to List: Connection Types in AdCOM
            1.0.
        didmd5:
          anyOf:
            - type: string
            - type: 'null'
          description: Hardware device ID (e.g., IMEI); hashed via MD5.
          title: Didmd5
        didsha1:
          anyOf:
            - type: string
            - type: 'null'
          description: Hardware device ID (e.g., IMEI); hashed via SHA1.
          title: Didsha1
        dpidmd5:
          anyOf:
            - type: string
            - type: 'null'
          description: Platform device ID (e.g., Android ID); hashed via MD5.
          title: Dpidmd5
        dpidsha1:
          anyOf:
            - type: string
            - type: 'null'
          description: Platform device ID (e.g., Android ID); hashed via SHA1.
          title: Dpidsha1
        ext:
          anyOf:
            - type: object
            - type: 'null'
          description: >-
            Placeholder for advertising-system specific extensions to this
            object
          title: Ext
        flashver:
          anyOf:
            - type: string
            - type: 'null'
          description: Version of Flash supported by the browser.
          title: Flashver
        geo:
          anyOf:
            - $ref: '#/components/schemas/Geo'
            - type: 'null'
          description: >-
            Location of the device assumed to be the user’s current location
            defined by a Geo object (Section 3.2.19).
        geofetch:
          anyOf:
            - $ref: '#/components/schemas/IsGeoSupported'
            - type: 'null'
          description: >-
            Indicates if the geolocation API will be available to JavaScript
            code running in the banner, where 0 = no, 1 = yes.
        h:
          anyOf:
            - type: integer
            - type: 'null'
          description: Physical height of the screen in pixels.
          title: H
        hwv:
          anyOf:
            - type: string
            - type: 'null'
          description: Hardware version of the device (e.g., “5S” for iPhone 5S).
          title: Hwv
        ifa:
          anyOf:
            - type: string
            - type: 'null'
          description: ID sanctioned for advertiser use in the clear (i.e., not hashed).
          title: Ifa
        ip:
          anyOf:
            - type: string
            - type: 'null'
          description: IPv4 address closest to device.
          title: Ip
        ipv6:
          anyOf:
            - type: string
            - type: 'null'
          description: IPv6 address closest to device.
          title: Ipv6
        js:
          anyOf:
            - $ref: '#/components/schemas/IsJSSupported'
            - type: 'null'
          description: Support for JavaScript, where 0 = no, 1 = yes.
        lang:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Browser language using ISO-639-1-alpha-2. Only one of language or
            langb should be present.
          title: Lang
        langb:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Browser language using IETF BCP 47. Only one of language or langb
            should be present.
          title: Langb
        lmt:
          anyOf:
            - $ref: '#/components/schemas/LimitAdTracking'
            - type: 'null'
          description: >-
            1 if the agent prefers a “mobile” version of the content, if
            available, i.e. optimized for small screens or touch input. 0 if the
            agent prefers the “desktop” or “full” content.
        macsha1:
          anyOf:
            - type: string
            - type: 'null'
          description: MAC address of the device; hashed via SHA1.
          title: Macsha1
        make:
          anyOf:
            - type: string
            - type: 'null'
          description: Device make (e.g., “Apple”).
          title: Make
        mccmnc:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Mobile carrier as the concatenated MCC-MNC code (e.g., “310-005”
            identifies Verizon Wireless CDMA in the USA).
          title: Mccmnc
        mccmncsim:
          anyOf:
            - type: string
            - type: 'null'
          description: MCC and MNC of the SIM card using the same format as mccmnc.
          title: Mccmncsim
        model:
          anyOf:
            - type: string
            - type: 'null'
          description: Device model (e.g., “iPhone”).
          title: Model
        os:
          anyOf:
            - type: string
            - type: 'null'
          description: Device operating system (e.g., “iOS”).
          title: Os
        osv:
          anyOf:
            - type: string
            - type: 'null'
          description: Device operating system version (e.g., “3.1.2”).
          title: Osv
        ppi:
          anyOf:
            - type: integer
            - type: 'null'
          description: Screen size as pixels per linear inch.
          title: Ppi
        pxratio:
          anyOf:
            - type: number
            - type: 'null'
          description: The ratio of physical pixels to device independent pixels.
          title: Pxratio
        sua:
          anyOf:
            - $ref: '#/components/schemas/UserAgent'
            - type: 'null'
          description: >-
            Structured user agent information defined by a UserAgent object (see
            Section 3.2.29).
        type:
          anyOf:
            - $ref: '#/components/schemas/DeviceType'
            - type: 'null'
          description: >-
            The general type of device. Refer to List: Device Types in AdCOM
            1.0.
        ua:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Browser user agent string. This field represents a raw user agent
            string from the browser.
          title: Ua
        w:
          anyOf:
            - type: integer
            - type: 'null'
          description: Physical width of the screen in pixels.
          title: W
      title: Device
      type: object
    Revenue:
      properties:
        currency:
          description: Currency code
          title: Currency
          type: string
        revenue:
          description: Revenue amount
          title: Revenue
          type: number
      required:
        - revenue
        - currency
      title: Revenue
      type: object
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          title: Location
          type: array
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
      required:
        - loc
        - msg
        - type
      title: ValidationError
      type: object
    CatalogMetadataSchema:
      additionalProperties: true
      description: |-
        Schema defining require and optional metadata fields for catalog items.

        Allows additional fields beyond the standard metadata structure.
      properties:
        brand:
          anyOf:
            - type: string
            - type: 'null'
          description: The brand of catalog item
          title: Brand
        category:
          description: The category of catalog item
          title: Category
          type: string
        created_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: The created at of catalog item
          title: Created At
        id:
          description: The ID of catalog item
          title: Id
          type: string
        image_link:
          description: The image link of catalog item
          title: Image Link
          type: string
        link:
          anyOf:
            - type: string
            - type: 'null'
          description: The link of catalog item
          title: Link
        seller_name:
          anyOf:
            - type: string
            - type: 'null'
          description: The seller name of catalog item
          title: Seller Name
        title:
          description: The title of catalog item
          title: Title
          type: string
        updated_at:
          anyOf:
            - format: date-time
              type: string
            - type: 'null'
          description: The updated at of catalog item
          title: Updated At
      required:
        - id
        - title
        - image_link
        - category
      title: CatalogMetadataSchema
      type: object
    ConnectionType:
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
      title: ConnectionType
      type: integer
    Geo:
      properties:
        accuracy:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Estimated location accuracy in meters; recommended when lat/lon are
            specified and derived from a device’s location services (i.e., type
            = 1). Note that this is the accuracy as reported from the device.
          title: Accuracy
        city:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            City using United Nations Code for Trade & Transport Locations. See
            Appendix A for a link to the codes.
          title: City
        country:
          anyOf:
            - type: string
            - type: 'null'
          description: Country code using ISO-3166-1-alpha-3.
          title: Country
        ext:
          anyOf:
            - type: object
            - type: 'null'
          description: >-
            Placeholder for advertising-system specific extensions to this
            object
          title: Ext
        ipservice:
          anyOf:
            - $ref: '#/components/schemas/IpLocationService'
            - type: 'null'
          description: >-
            Service or provider used to determine geolocation from IP address if
            applicable (i.e., type = 2). Refer to List: IP Location Services in
            AdCOM 1.0.
        lastfix:
          anyOf:
            - type: integer
            - type: 'null'
          description: >-
            Number of seconds since this geolocation fix was established. Note
            that devices may cache location data across multiple fetches.
            Ideally, this value should be from the time the actual fix was
            taken.
          title: Lastfix
        lat:
          anyOf:
            - type: number
            - type: 'null'
          description: Latitude from -90.0 to +90.0, where negative is south.
          title: Lat
        lon:
          anyOf:
            - type: number
            - type: 'null'
          description: Longitude from -180.0 to +180.0, where negative is west.
          title: Lon
        metro:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Google metro code; similar to but not exactly Nielsen DMAs. See
            Appendix A for a link to the codes.
          title: Metro
        region:
          anyOf:
            - type: string
            - type: 'null'
          description: Region code using ISO-3166-2; 2-letter state code if USA.
          title: Region
        regionfips104:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            Region of a country using FIPS 10-4 notation. While OpenRTB supports
            this attribute, it was withdrawn by NIST in 2008.
          title: Regionfips104
        type:
          anyOf:
            - $ref: '#/components/schemas/LocationType'
            - type: 'null'
          description: Source of location data; recommended when passing lat/lon.
        utcoffset:
          anyOf:
            - type: integer
            - type: 'null'
          description: Local time as the number +/- of minutes from UTC.
          title: Utcoffset
        zip:
          anyOf:
            - type: string
            - type: 'null'
          description: ZIP or postal code.
          title: Zip
      title: Geo
      type: object
    IsGeoSupported:
      enum:
        - 0
        - 1
      title: IsGeoSupported
      type: integer
    IsJSSupported:
      enum:
        - 0
        - 1
      title: IsJSSupported
      type: integer
    LimitAdTracking:
      enum:
        - 0
        - 1
      title: LimitAdTracking
      type: integer
    UserAgent:
      properties:
        architecture:
          anyOf:
            - type: string
            - type: 'null'
          description: Device’s major binary architecture, e.g. “x86” or “arm”.
          title: Architecture
        bitness:
          anyOf:
            - type: string
            - type: 'null'
          description: Device’s bitness, e.g. “64” for 64-bit architecture.
          title: Bitness
        browsers:
          anyOf:
            - items:
                $ref: '#/components/schemas/BrandVersion'
              type: array
            - type: 'null'
          description: >-
            Each BrandVersion object (see Section 3.2.30) identifies a browser
            or similar software component.
          title: Browsers
        ext:
          anyOf:
            - type: object
            - type: 'null'
          description: >-
            Placeholder for advertising-system specific extensions to this
            object
          title: Ext
        mobile:
          anyOf:
            - $ref: '#/components/schemas/IsMobile'
            - type: 'null'
          description: >-
            1 if the agent prefers a “mobile” version of the content, if
            available, i.e. optimized for small screens or touch input. 0 if the
            agent prefers the “desktop” or “full” content.
        model:
          anyOf:
            - type: string
            - type: 'null'
          description: Device model.
          title: Model
        platform:
          anyOf:
            - $ref: '#/components/schemas/BrandVersion'
            - type: 'null'
          description: >-
            A BrandVersion object (see Section 3.2.30) that identifies the user
            agent’s execution platform / OS.
        source:
          anyOf:
            - $ref: '#/components/schemas/UserAgentSource'
            - type: 'null'
          description: >-
            The source of data used to create this object, List: User-Agent
            Source in AdCOM 1.0
      title: UserAgent
      type: object
    DeviceType:
      enum:
        - 1
        - 2
        - 3
        - 4
        - 5
        - 6
        - 7
        - 8
      title: DeviceType
      type: integer
    IpLocationService:
      enum:
        - 1
        - 2
        - 3
        - 4
      title: IpLocationService
      type: integer
    LocationType:
      enum:
        - 1
        - 2
        - 3
      title: LocationType
      type: integer
    BrandVersion:
      properties:
        brand:
          description: A brand identifier, for example, “Chrome” or “Windows”.
          title: Brand
          type: string
        ext:
          anyOf:
            - type: object
            - type: 'null'
          description: >-
            Placeholder for advertising-system specific extensions to this
            object
          title: Ext
        version:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          description: >-
            A sequence of version components, in descending hierarchical order
            (major, minor, micro, …)
          title: Version
      required:
        - brand
      title: BrandVersion
      type: object
    IsMobile:
      enum:
        - 0
        - 1
      title: IsMobile
      type: integer
    UserAgentSource:
      enum:
        - 0
        - 1
        - 2
        - 3
      title: UserAgentSource
      type: integer

````