Log a cookie consent action

Records one consent action from the site's consent banner. Send `visitorId`, `action` and `consentGiven`, plus the optional `sessionId`, `pageUrl` and `locale`. Pass the `locale` you sent to `GET /cookie-consent/config`: the log then records the banner language served and its `version`. It also stores the `User-Agent` and a site-scoped hash of the client IP, never the raw IP. The route takes no credential and no spam fields, so a logged row does not prove that a real visitor made the choice. Returns 200. An invalid field returns 422 and nothing is recorded.

Required access
No credentialOptional: publishable keySite access
POST/cookie-consent/logs
Base URLhttps://api.lynkow.com/storefront/{siteId}

Request body
required

  • action
    enum
    required

    Required. The consent action: `accept_all`, `reject_all`, `customize` or `withdraw`.

    One of: accept_allreject_allcustomizewithdraw

  • consentGiven
    object
    required

    Required. Maps each category id to `true` (accepted) or `false`. At most 100 keys, each 1 to 50 characters.

  • visitorId
    string
    required

    Required. The visitor's stable identifier, 1 to 64 characters after surrounding whitespace is trimmed.

  • locale
    string

    Banner language requested, as sent to `GET /cookie-consent/config`. An unmatched value uses the site default, then English.

  • pageUrl
    string

    Absolute `http` or `https` URL of the page, up to 2048 characters. Any other scheme, or none, returns 422.

  • sessionId
    string

    Analytics session ID. UUID format

Feedback

Was this page helpful?