What is a cookie?

The word cookie gets thrown around a lot - but what does it actually mean? In this article we go through what a cookie is, other type of storage and pixels.

cookies

What is a cookie? 

A cookie is a text file that websites put on your hard drive to identify your computer. The next time you visit the website, it will read the file and remember what it put there. 

Most of us have visited a website that saved your username for easier access to log in - that's because of cookies! 

But what about third-party cookies? 

There are two types of cookies - first-party and third-party cookies. 

First-party cookies are cookies that only the website or server that created them can read. So if you visited example.com and it set the first-party cookie "examplecookie", only example.com would be able to read it and access the information. 

Third-party cookies are cookies from which websites other than the one who created it can read and access information. They are commonly used for advertising, to allow advertisers to serve ads and track user behavior over multiple sites. 

And session storage? 

sessionStorage (also known as session storage) only lasts a session (hence the name) then they're deleted. The session storage are stored in a temporary memory location in your browser, not on your device like traditional cookies. 

The session storage is set when you launch a website or web application and is deleted once you leave the website or close the browser window. 

Local storage? 

localStorage (also known as Local storage or LocalStorage) is stored in the browser and unlike session storage, doesn't have an expiration date and will not be deleted after closing the browser window. Because of that, local storage is good for saving user information while offline or to save user preferences. 

Pixels though? 

picture iconA pixel is usually a transparent or camouflaged small picture that contains a small snippet of code. It's usually very small - only a pixel wide so the user can't see it on your website. The pixel loads together with the other content on a webpage or e-mail and sends information directly to the pixel company's server.  There are two main types of pixels - conversion and retargeting pixels. 

Conversions pixels are used to track the effectiveness of marketing campaigns and are usually placed on "thank you"-pages or in order confirmation e-mails. It sends over information about ads the customer saw and if they used an affiliate partner's link. 

Retargeting pixels track how the user has behaved on your website which allows the advertiser to show targeted ads to the user. They are similar to third-party cookies, with the distinction that pixels send information directly to the web servers, where cookies are placed on a user's browser and are then read. 

Tags?  

Tags (also known as container tags or site tags) contain scripts you inject into your website. Sometimes the words pixel and tags are used interchangeably, but while all pixels are tags - not all tags are pixels.  You can hardcode tags into your website or use a tag manager.