Who Took the Cookie? The Science Behind Targeted Advertising

Posted by Chad Coleman
min read
February 2nd, 2018

Targeted ads, or those personalized ones that follow you around on the internet containing products that you actually might like, have a lot of connotations tied to them: they’re creepy, they’re not quite accurate, and they’re even potentially embarrassing, among other things.

However you feel about targeted ads, it’s safe to say that, if you’re going to be targeted by brands, it’s at least nice to have relevant purchase suggestions instead of the usual mishmash of products that you’d never even consider buying.

That’s why it’s important to get an understanding of the science of personalized ads from a marketer and consumer perspective—you know what you’re in for and why it may be best to let them keep doing their thing.

So how do these work? Let’s dig in to the details.

What is a cookie?

person making cookies

Normal people prefer chocolate chip; marketers prefer text files.

A cookie is a small piece of code called a pixel that is placed on a website.

Every time a new visitor comes to that website, the cookie is dropped by the website’s server onto a user’s computer—but only on the internet browser level.

Each new cookie that’s dropped creates a unique identifier code for every new user, and that becomes the user’s “name” (your real name is kept anonymous).

Then, the data on your activity tracked from site to site and then collected and compiled into a profile, which includes your browsing behavior, interests, and demographics.

Once a user is identified, the web pages you’re on will recognize your tracking code and display relevant ads to you in whatever places the page designates for personalized ad displays (more on the actual personalized ads later). These cookies can only be placed or retrieved for use when the user accesses the website server directly or by means of a third party tag.

First party cookies are placed by the site you visit, while third party cookies are placed by someone other than the site, such as an advertising network.

It’s important to note that only the domain or website that places the cookie can read and use it.

Also, personalized and targeted ads cannot work without cookies, making them extremely important to the customer experience and highly valuable to marketers as a result.

So, how does the cookie collect information?

The cookie itself allows websites to recognize a visitor when that user revisits their site, but only if the user has previously identified himself with personal data that will allow him to be recognized upon his return.

This gives the website access to data stored in cookies on the visitor’s hard drive. However, cookies don’t gain access to data stored on user’s hard disk, which protects the user’s privacy.

When cookies are used by ad networks or third party marketing services, they allow marketers to follow users on all websites where third party tags are added—but not beyond that realm.

Pros and cons of cookies for users

woman looking at a donut


Users can be recognized from visit to visit, and their login information, including their username and password, can be auto-filled so that they don’t have to type it out every time, making their login process less tedious.

Users’ preferences are saved and used for future visits, helping user experience and ease of browsing.

Shopping cart contents are maintained during and between visits on ecommerce sites, so if an app force quits or you forget to check out, you don’t have to start the shopping trip from the beginning.

Cookies help ad effectiveness: users see ads for products that actually appeal to them, improving the overall level of interest and browsing experience.

Personalization has some perks, too, as prices and offers may be tailored to specific users and make them feel like a select and valued customer.

Users can choose which browser they want to use based on privacy preferences, so they’re not completely without choice in the whole matter.


Cookies can be seen as a privacy violation when used for ad purposes, making some users feel rather uneasy about the whole thing.

They can slow down the browsing experience as they accumulate, forcing users to have to go and manually “clean out” their stored cookies to improve performance.

Research shows that the NSA can tap into this data, too, which is not at all what cookies were created for and therefore can be unsettling and unethical.

They’re not entirely anonymous and can be linked to actual identities if the time is put into analyzing the data and patterns.

Worse yet, someone can accidentally leak personal information if the data is in the wrong hands.

Pros and cons of cookies for marketers

notebooks and cookies from a birds eye view


Users can be identified by publishers and ad networks for behavioral targeting and website retargeting. In other words, relevant ads have never been easier to whip up.

Cookies help enhance the overall ad effectiveness and user experience, which in turn increases ROI.

Users can be tracked for web analytics purposes, helping brands to best serve their customers on the digital side.

Combining network behaviors, marketers can determine all of your devices and combine all of the browsing behavior to build an even deeper and clearer profile.


Cookies identify the computer’s IP address, not technically the user himself. When a computer is shared, the data gets muddled—unless multiple users have separate profiles in the browser.

They can certainly be blocked by the user, or users can opt out, delete, or otherwise disable the full potential of cookies. Though it makes browsing more manual for the user, oftentimes, it’s a question of privacy versus convenience.

Each internet browser has its own cookies, so marketers are left with a lot of decisions based on where their audience browses and the benefits that each offers.

Types of cookies

shelf with variety of cookies

There are so many types of cookies, but we’re going to focus on the three most important ones that everyone should be familiar with.

Session cookie

It’s a temporary cookie that’s stored in your browsing session memory and then erased when the web browser is closed. It’s used for session analytics, not identifying information.

Third party cookie

As you read earlier on, these are cookies that are placed on a website by a third party, such as an advertising network or marketing service.

Persistent cookie

These cookies are stored on the hard drive until they expire or are deleted, hence the name “persistent” as they don’t disappear easily. These are used for identifying information, such as user preferences and surfing behavior.

There are also flash, post-click, post-impression, and conversion cookies, but they’re not as commonly used as the three above.

Rise of cookie use

a basket of cookies

As with most technological advances, cookie usage has exploded in just a few years. 75% of the world’s 500 most popular websites contain cookies, compared with less than 5% in 1998. That’s a huge difference!

Google dominates in terms of cookie usage as much as it does in search engine popularity: Google Analytics cookies appeared on more than 30% of the most popular websites. Furthermore, Google’s DoubleClick ad server appeared on another 15% of the sites.

Needless to say, cookies aren’t going anywhere anytime soon.

If anything, marketers will just get increasingly better at using and analyzing them to make ads feel less like ads and more like gently suggestions from informed sources.

Perhaps they'll find a simpler way to analyze and utilize multi-device targeting with cookies, too. Speaking of which...

What is multi-device targeting?

person looking at smartphone

Not all of our online activity happens on desktop computers anymore; in fact, about half of browser searches now happen on mobile devices alone.

Marketers can leverage our multi-device habits in a slightly different way since cookies cannot be tracked from one device to another.

Better yet, companies will take browsing behavior from different devices and match habits across each to the best of their ability. The formal name for this practice of studying millions of web users to match people to their devices is called probabilistic matching.

There’s big business in this new industry, too, as companies learn about your devices and interests by tracking tons of ad requests daily from internet ad exchanges selling in real time.

This setup allows potential buyers to see device types, IP addresses, browsers, and more to paint a full picture of the user and be more confident with where they put their money.

The biggest clue for matching devices is when two devices use the same IP address when browsing at home. There are a couple other clues, too, such as search patterns for the same product conducted in the same geographical location.

Why is multi-device targeting so important? It has been determined that consumers tend to search for products on mobile devices, then go complete the purchase on desktop computers instead.

When you factor in consumer buying habits and then optimize to get them while they’re willing to buy, your chances of closing the deal can skyrocket.

For example, one company launched a cross-platform ad that yielded three times greater response than traditional internet ads would have.

What is personalized advertising?

gingerbread man cookie with a P

While this used to be simply called internet-based advertising, the term has matured with the tech itself.

This new method enables advertisers to reach users based on their interests, demographics, behavior, and more. It also allows for more efficient monetization of websites, increased value for advertisers, and better user experience all around.

In fact, a study found that 71% of consumers actually prefer personalized ads.

Even so, they have some work to do: consumers expect the content to be both useful and contextually relevant to their needs, every. Single. Time.

The more marketers can nail presenting the right information at the right time, the better off we’ll all be.

There are a lot of benefits to personalized advertising, too:

  • The relevancy of ads is significantly improved.
  • It’s a great way to discover new products and brands.
  • It makes shopping online a little more effortless and a lot less stressful.
  • Personalized ads boost engagement, as people are almost twice as likely to click-through an ad from an unknown brand that it well-tailored and relevant to their preferences. It’s a win-win for the smaller brand and the user!
  • 44% of respondents to a survey said they’re perfectly willing to give up information such as their name, address, and email to get more personalized ads, which means that their benefits are apparent to consumers as well as marketers.
  • Overall, personalized ads reduce friction and improve the shopping experience.

How do personalized ads work?

woman browsing on computer while drinking milk

When you browse a brand’s website, then go to a different place on the internet, you may have noticed that you’ll start seeing ads pop up everywhere for that brand or product you were just checking out.

You’ll even go to another page or entirely different website only to find the same: more of those ads. Why does this happen?

Marketers take the clickstream data collected by the cookies we discussed earlier and then use the data from those to tailor ads to you based on your browsing information and preferences.

Then, they analyze the search terms you use and other user habits you inevitably have in order to place the right ads in your search engine results.

You’ll notice that some searches yield ads right on the top of the list—that’s because those companies are paying a premium price on particular keywords for a higher position in your results list.

Then there’s your previous purchase data, including items you once put in your cart and later abandoned, that factors in, too. This information helps brands suggest related items or even replacement items if the ones you purchased are able to be used up.

The goal is to entice users to come back and buy more or reconsider the items they previously abandoned.

Finally, marketers will pull data from your social profile as well, such as brands you follow, ads you’ve clicked on, your selected interests, and more. This social data is used to provide users with custom advertising within the platform.

Facebook can even collect data on you from any site that contains a Facebook like or share button, too. While it may seem like you merely think about a donut and suddenly an ad for Krispy Kreme pops up, it’s likely that you’ve searched for donuts before or even mentioned somewhere on Facebook that they’re your favorite pastry.

All of this information above is then collected into a robust user profile and utilized by marketers for the purpose of making defined audience segments and effectively cater ads to each.

While this tactic evolved from simple demographic targeting, it uses more data and results in significantly more accuracy per user.

There are plenty of types of targeting:

  • Search engine marketing
  • Social media targeting
  • Mobile targeting
  • Contextual targeting
  • Technical targeting (based on device)
  • Location-based targeting
  • Behavioral (based on activity)
  • Retargeting (based on previous interaction with the content)

Each of these uses certain types of information, from the device you use to the language your keyboard is set to.

As a non-digital example of language targeting, I once received an internet provider offer in Polish—it’s my first language, so it made sense, but it was delivered to my house in Denver, which is a very non-Polish area. Needless to say, I was more impressed than usual with their use of data and accuracy.

Some of the most common information that marketers collect via cookies is demographic, psychographic, and behavioral (including browsing history, purchase history, and overall activity).

There are some pros and cons to the use of personalized ads, as marketers have yet to attain the perfect level of targeting users at the right time, right place, right mindset, and right budget.

Some pros are that the ad may be bothering you, yes, but it’s at least bothering you about something that you may actually be interested in rather than something entirely irrelevant to your life.

It also minimizes waste for advertisers, diminishes ad spend, reduces bounce rates, and increases ROI.

On the downside, you can trigger retargeting unintentionally for one-off purchases that aren’t actually relevant to you. For instance, if you buy a gift for a loved one, you get targeted for those products long after the purchase and can get irritated.

It can also be very embarrassing for the user if anyone else sees the ads in their browser—when my boyfriend bought me a cardigan from this one brand, he was quite uncomfortable with the resulting sports bra ads that the brand started dishing up on his browser day in and day out.

Some may see it as a slight invasion of privacy as their interests or shopping history are dangled in their faces for anyone near the device to see.

There are bigger problems with personalized ads than irrelevancy, though, so it’s important to be aware of why they’re still not the perfect solution for marketers.

The problem with personalized ads

person clapping floured hands together

First and foremost, people value their privacy.

Many fear that the data collected from cookies can put together a robust image of their true identity, and the fact that the NSA piggybacked off of profiles created for marketing purposes is certainly concerning and unethical.

Nevertheless, marketers create terms of use and many clearly lay them out on the bottom of a website to show users that they mean business, not identity theft, which helps alleviate some skepticism.

The second issue with personalized ads is entirely inevitable and inescapable: some people just hate advertising in general.

In fact, millennials are the most skeptical generation and try to opt out of ads entirely by leveraging ad blocking technology.

95% of users surveyed in one report said that they take actions to avoid seeing or receiving ads altogether, which entails avoiding signing up for email lists, disabling cookies, and using ad blockers as mentioned above.


Well, it turns out that plenty of people would prefer to discover their own content on their own terms, essentially being in charge of their own personalization.

This is because many users want to retain full control of what they see and browse through, likely because their standards for ads are that they should be fully customizable to their interests and must hold their attention and cause them to spend more time on the content.

If marketers can get to that advanced of a level of personalized advertising, it would lead to:

  • 62% more users seeking out information about the brand in the ad
  • 53% of users becoming more likely to remember the brand from the ad
  • A gratitude effect, where users form a relationship with a brand because it delivers the right experience and puts in the effort to tailor to their individual preferences

The Bottom Line

rows on rows of maracons

If marketers want to receive less skepticism and convert even more users through personalized ads, they must step it up.

The respondents from the study mentioned above provided resoundingly negative feedback on the current quality of the messaging and ads themselves.

Worse yet, more than half of the respondents stated that they would prefer personalized ads, just not today’s standard of such.

Of course, we are limited by our technology, so it’s going to take some time to get to the next level of this strategy.

What are your thoughts on personalized ads?

Love ‘em, hate ‘em, don’t mind ‘em too much?

Share with us in the comments below!