Collect an analytics event

Records one analytics event. Always returns 204 with an empty body, also when the event is dropped: an invalid body, an excluded IP or path, tracking turned off, or a localhost origin. Send `application/json` with `session_id` (a UUID per visit), `visitor_id` (stable per browser, 8 to 64 characters), `event_type`, `page_path` and `event_time` (ISO 8601). Every other field is optional.

Required access
No credentialOptional: publishable keySite access
POST/analytics/events
Base URLhttps://api.lynkow.com/storefront/{siteId}

Request body
required

  • event_time
    string
    required

    Required. Event time (ISO 8601). A time far from the server clock is replaced by the receive time

  • event_type
    enum
    required

    Required. Kind of event, such as `pageview`, `heartbeat` or `click`

    One of: pageviewscrolltime_on_pagecwvexitheartbeatclickoutbound_linkfile_downloademail_clickphone_clickrage_clickdead_clickcopyform_startform_submitform_abandonform_fieldform_errorheatmap_click

  • page_path
    string
    required

    Required. Max 1024 characters

  • session_id
    string
    required

    Required. Analytics session UUID. UUID format

  • visitor_id
    string
    required

    Required. 8-64 characters

  • browser
    union

    Browser name

  • browser_version
    union

    Browser version string

  • click_count
    union

    Number of clicks recorded for the event

  • click_element
    union

    Descriptor of the clicked element

  • click_element_class
    union

    Class attribute of the clicked element

  • click_element_id
    union

    ID attribute of the clicked element

  • click_element_tag
    union

    Tag name of the clicked element

  • click_element_text
    union

    Text content of the clicked element

  • click_target_url
    union

    Target URL of the clicked link

  • click_x
    union

    Horizontal click coordinate in pixels

  • click_y
    union

    Vertical click coordinate in pixels

  • cls
    union

    Cumulative Layout Shift score (unitless, Core Web Vital)

  • content_locale
    union

    Language of the page being read. A language the site does not offer is stored as `null`

  • cookie_visitor_id
    union

    Ignored. Accepted so older trackers keep working: the collector reads the cookie from the request

  • copied_text
    union

    Text copied by the visitor (copy event)

  • device_type
    union

    Device category: desktop, laptop, mobile, tablet

  • engaged_time
    union

    Active engagement time in milliseconds (max 3600000)

  • error_message
    union

    Form validation or submission error message

  • fid
    union

    First Input Delay in milliseconds (Core Web Vital)

  • field_name
    union

    Name of the form field involved in the event

  • field_time
    union

    Time spent on the form field in milliseconds

  • field_type
    union

    Type of the form field involved in the event

  • file_extension
    union

    Extension of the downloaded file

  • file_name
    union

    Name of the downloaded file

  • file_url
    union

    URL of the downloaded file

  • form_completion_rate
    union

    Form completion rate as a percentage (0-100)

  • form_id
    union

    Identifier of the form involved in the event

  • form_name
    union

    Name of the form involved in the event

  • inp
    union

    Interaction to Next Paint in milliseconds (Core Web Vital)

  • is_entry
    boolean

    Send `true` on the first `pageview` of a visit: it opens the session, and later events only update an open one

  • is_exit
    boolean

    `true` on the event that ends the visit; the page report counts it as an exit from `page_path`

  • language
    union

    Browser language code

  • lcp
    union

    Largest Contentful Paint in milliseconds (Core Web Vital)

  • max_scroll_depth
    union

    Maximum scroll depth reached as a percentage (0-100)

  • os
    union

    Operating system name

  • os_version
    union

    Operating system version string

  • page_referrer
    union

    URL of the referring page

  • page_title
    string

    Max 500 characters

  • page_url
    string

    Max 2048 characters

  • referrer_domain
    union

    Domain of the referrer

  • screen_height
    union

    Screen height in pixels

  • screen_width
    union

    Screen width in pixels

  • scroll_behavior
    union

    Scroll behavior pattern: reading, skimming, jumping

  • scroll_depth
    union

    Scroll depth as a percentage (0-100)

  • time_on_page
    union

    Time on page in milliseconds (max 3600000)

  • timezone
    union

    Timezone name (IANA, e.g. Europe/Paris)

  • traffic_source
    union

    Traffic source channel: direct, organic, social, paid, referral, email, internal, ai

  • ttfb
    union

    Time To First Byte in milliseconds

  • utm_campaign
    union

    UTM campaign name parameter

  • utm_content
    union

    UTM content campaign parameter

  • utm_medium
    union

    UTM medium campaign parameter

  • utm_source
    union

    UTM source campaign parameter

  • utm_term
    union

    UTM term campaign parameter

  • viewport_height
    union

    Viewport height in pixels

  • viewport_width
    union

    Viewport width in pixels

  • visitor_id_source
    enum

    One of: cookie, fingerprint, hybrid

    One of: cookiefingerprinthybrid

Feedback

Was this page helpful?