What is a cookie?
A cookie is a small piece of data that a website saves in a visitor's browser. It lets the site remember things like login status, cart contents, or preferences. Marketers also use cookies to recognize returning visitors and measure ads.
Last reviewed .
How cookies work
When you visit a site, it can ask your browser to store a cookie. On later visits, the browser sends the cookie back so the site can recognize you.
Cookies can last for one session or for a set period, and visitors can clear them at any time.
First-party and third-party cookies
A first-party cookie is set by the site you're visiting. A third-party cookie is set by a different domain, often an ad or analytics provider embedded on the page.
Browsers have placed more limits on third-party cookies over time, so many marketers rely more on first-party data and server-side methods.
Cookies and privacy
Many privacy laws require you to tell visitors which cookies you use and, in some cases, get consent first. A consent management platform handles this for most sites.
Common questions
What are cookies used for in marketing?
They help measure site visits, recognize returning visitors, store attribution details, and support ad targeting and conversion tracking.
Do cookies contain personal information?
Often they hold only a random ID, but that ID can link to personal data stored elsewhere. Privacy laws can treat cookie IDs as personal data.
How long do cookies last?
It depends on how they're set. Some end when the browser closes, and others last days or longer. Browsers may also limit lifespans for some cookies.
Can I track visitors without cookies?
Partly. Server-side tracking, logged-in user IDs, and first-party data can measure behavior without relying on browser cookies alone.
Want help putting this to work?
Tell us where your marketing stands today, and we'll show you what to do first.