Skip to content

What to put in for custom cookie #7846

Answered by squidfunk
ydkmlt84 asked this question in Q&A
Discussion options

You must be logged in to vote

It's basically just an identifier, specifically custom that you can query in JavaScript to do whatever you want with it, as mentioned. For instance, you can call it banana:

analytics:
    ...
    cookies:
      banana: some_value

And then:

var consent = __md_get("__consent")
if (consent && consent.banana) {
   consent.banana // will contain "some_value"
} else {
   // No cookie for you
}

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@ydkmlt84
Comment options

ydkmlt84 Dec 27, 2024
Author Sponsor

@squidfunk
Comment options

@ydkmlt84
Comment options

ydkmlt84 Dec 27, 2024
Author Sponsor

Answer selected by kamilkrzyskow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants