Retail Media Concepts
Contextual vs Behavioral Targeting: The Difference, With Retail Examples

Table of contents
The retail media edge, before everyone else has it.
Contextual vs behavioral targeting comes down to the data each reads: contextual targeting shows an ad based on what a person is looking at right now, such as a page or a search, while behavioral targeting shows it based on what that person did before, such as past visits or purchases. On a retailer's own site, the context is the live search query and the product page, and the behavior is a record of real purchases, so both signals run on the retailer's own data without third-party cookies.
Contextual vs behavioral targeting comes down to the data each reads: contextual targeting shows an ad based on what a person is looking at right now, such as a page or a search, while behavioral targeting shows it based on what that person did before, such as past visits or purchases. On a retailer's own site, the context is the live search query and the product page, and the behavior is a record of real purchases, so both signals run on the retailer's own data without third-party cookies. Osmos helped BigBasket drive 8% revenue growth with smarter keyword expansion, by getting advertisers to bid on more of the search keywords shoppers type.
Osmos is a white-label retail media operating system for retailers and marketplaces. Its modular apps for onsite, offsite and in-store ads sit over your existing stack, so you can break your monetisation ceiling faster without rebuilding it.
Last updated: November 2026 · Reviewed by Kunal Damgude, Growth and Product Marketing Manager
What is the difference between contextual and behavioral targeting?
Contextual targeting uses the attributes of the content, and behavioral targeting uses the attributes of the person. The clearest industry definitions still come from IAB UK's Contextual Targeting Group, published in 2021. It describes contextual advertising as "targeted based purely on the subject and environment of the content", and adds that it "is not based on any characteristics of the user and therefore does not rely on any personally identifiable information (PII)" (IAB UK, 2021). Behavioural advertising, by the same glossary, is "targeted based on attributes of the user, as opposed to the targeting being based on attributes of the content."
Contextual targeting is the practice of matching an ad to the page, query or product a shopper is looking at, at the moment of viewing, without needing to know who the shopper is.
Behavioral targeting is the practice of matching an ad to a person's past actions, such as purchases, visits, searches and clicks, collected over time and tied to a profile or identifier.
On a retailer's site both definitions take a specific shape. Contextual means a shopper has typed "oat milk" or opened the baby-care aisle, and the ad server responds to that. Behavioral means the shopper bought oat milk every ten days for three months, and the ad server responds to that pattern even when today's visit started on the homepage. Osmos builds for both inside one onsite ad server: its Product Ads rank sponsored listings on signals that include the shopper's search and category context together with cart and purchase history, so one retailer site can run both models at once.
Contextual targeting vs traditional targeting
Traditional targeting usually means demographic and geographic segments set before a campaign starts: women aged 25 to 34, shoppers in one city, households with children. Contextual targeting reads the environment at the moment the ad is served: the query, the page, the product, the basket. Behavioral targeting sits between the two, because it describes the person through actions the retailer has observed. For a retailer, the useful order of precision is usually typed intent first, observed purchase behavior second, and broad demographics last.
Contextual advertising vs behavioral advertising: one example each
A contextual targeting example: a shopper searches "sugar-free chocolate", and the results page shows a sponsored listing for a stevia-sweetened dark chocolate bar and a display unit for a diabetic-friendly snack range, chosen from the query alone.
A behavioral targeting example: a logged-in shopper who has bought premium dark chocolate as a gift every month opens the app in early February, and the homepage carousel promotes a Valentine's gift box from a premium brand. The purchase history chose that ad on a homepage that carried no chocolate signal of its own.
Contextual vs behavioral targeting: side-by-side comparison
| Contextual targeting | Behavioral targeting | How a retailer combines them | |
|---|---|---|---|
| Signal read | The live search query, category page, product page or basket contents | Past purchases, visit frequency, category affinity, earlier searches and clicks | The query or page filters which ads are eligible, and the shopper's purchase history reorders them |
| Moment it acts | The current session, at the point of intent | Across sessions, often weeks or months of history | Real time ranking that blends the live signal with stored history |
| Data and consent exposure | Strong on privacy: reads the page, so the page signal needs no personal data | Strong on precision: uses data tied to an individual, which makes consent and purpose limits part of the design | Page context runs for everyone; personal signals switch on where the shopper has consented |
| New or logged-out shopper | Works from the first page view | Works once a shopper has history; thin for new or anonymous shoppers | Contextual signals serve new shoppers while their purchase history is still empty |
| Eligible audience | Every shopper who reaches the page or query | Shoppers with enough recorded history, usually the logged-in base | Context reaches every shopper on the page, including anonymous ones, and purchase history refines the ads shown to known shoppers |
| Where it runs | Onsite search results, category pages, product pages and cart. In Osmos, the white-label retail media operating system for retailers and marketplaces, Product Ads and Display Ads read this context | Onsite personalization for known shoppers, and offsite audience extension. Osmos Offsite carries the retailer's first-party audiences to Google, Meta and TikTok | One ad server and one auction onsite, with the same audiences reused offsite |
| How to measure | Revenue per thousand impressions and advertiser return on ad spend (ROAS) by query and category | The same metrics by audience segment, plus repeat purchase and new-to-brand sales for the advertiser | Split tests per placement, closed-loop to orders |
| Main limit | Reads the moment only; a one-word query can carry several meanings | Past behavior can go stale, and one account can hide several shoppers or a one-off gift | The current session overrides old purchase data, and past purchases clarify what a short search term means for a known shopper |
What is contextual advertising?
Contextual advertising is advertising bought against a setting, such as a topic, a keyword, a page or a product shelf, read at the moment the ad is served and shown to whoever is looking at it. On a publisher's site the setting is an article or a video. On a retail site it sits much closer to a purchase, because the shopper is already looking at products.
Contextual targeting comes in five common types, and a retail site carries all five:
- Keyword targeting: the ad matches the words in a search. On a retail site the search query is the keyword, and advertisers bid on it directly.
- Category or topic targeting: the ad matches the subject of the page. On a retail site the subject is an aisle in the product taxonomy, such as baby care or gluten-free crackers.
- Semantic targeting: the ad matches what the words mean, so a misspelled, partial or ambiguous query still reaches relevant ads.
- Product page targeting: the ad matches the brand, price point, pack size and attributes of the product on screen.
- Basket targeting: the ad matches what the shopper has already put in the cart during this visit.
Product page and basket targeting need a site where shoppers buy products. There the ad server can see that a shopper is looking at a 1 kg bag of almond flour and already has eggs in the cart.
What is behavioral advertising?
Behavioral advertising is advertising bought against a person's recorded actions. The ad follows the person, so two visitors on the same page at the same moment can see different ads.
On the open web, behavioral advertising builds an interest profile from browsing across many sites, traditionally carried by third-party cookies and other identifiers, and retargeting is its best-known form. That profile is inferred from reading, so someone who read three dessert articles gets tagged as a person who likes chocolate.
In retail media the profile is built from recorded purchases. A retailer's data records, for example, that the same person bought the same 70% dark chocolate bar six times since spring. The retailer collects that record on its own site and app, so it needs no cookie from another company, and it shows what the shopper actually paid for.
Contextual vs behavioral targeting: pros and cons
| Pros | Cons | |
|---|---|---|
| Contextual targeting | Needs no personal data for the page signal and reaches anonymous and first-time shoppers from the first page view. Follows typed intent, the most precise signal on a search page. When the search changes, the ads change with it | Keeps no memory of the shopper, and a short query can be ambiguous. Has little to work with where there is no query or product, such as the homepage |
| Behavioral targeting | Precise on known shoppers, because purchase history shows what they buy and how often. Works on placements with no query, such as the logged-in homepage, and offsite. Powers repeat purchase and win-back plays | Starts cold for new or anonymous shoppers. Uses personal data, so profiling and consent rules apply. Goes stale without maintenance, and an ad that keeps following a shopper after the purchase wastes the impression |
Which is better, contextual or behavioral targeting?
Both drive revenue on the placements that suit them, and no neutral, current benchmark ranks one above the other in retail media.
A 2021 meta-analysis of 96 studies and 597 effect sizes found that matching an ad to the topic of editorial content "resulted in a very weak influence on attitudes/PI" (University of Georgia Grady College, 2021). The context in those studies was editorial. On a retailer's search page the context is a typed product query, which is declared intent, stated on the page where the shopper can buy.
A retailer leads with context where the intent is typed and the shopper may be anonymous, such as search results and category pages, and leads with purchase history where the shopper is known but the placement is not search-led, such as the logged-in homepage and post-purchase pages. Every other placement is settled by testing it on revenue per thousand impressions for the retailer and ROAS for the advertiser.
How does behavioral targeting work in retail media?
Behavioral targeting in retail media works from what shoppers have actually bought on the retailer's own site and app. Retailers put that purchase history to work in four plays:
- Replenishment prompts: a shopper who buys dog food every four weeks sees a sponsored listing from their usual brand, or a competing brand, as the next purchase approaches.
- Category expansion: a shopper who buys baby wipes and formula is shown a toddler snack range as the child's age implies the next stage.
- Lapsed-buyer win-back: a shopper who stopped buying a brand's coffee two months ago sees that brand's new blend on the homepage.
- Loyalty tiers: frequent, high-spend shoppers in a category see premium ranges first.
Behavioral signals need maintenance to stay accurate. A purchase from last week says more than one from last year, so older signals decay. Households share accounts, so one shared profile mixes a parent's coffee with a teenager's energy drinks. One-off purchases, especially gifts, should stop driving ads once the occasion has passed.
A retailer that decays old signals and discounts one-offs keeps the main strength of behavioral targeting, precision on known shoppers, and avoids the stale profiles that gave open-web retargeting a poor reputation. Ranking models apply these decay and discount rules to every impression as it is served (AI-powered ad serving and behavioral targeting).
The second home for behavioral targeting is offsite. A retailer's purchase-based audiences can reach the same shoppers on social and search platforms, with results tied back to sales on the retailer's own site. Osmos Offsite runs this on the retailer's own seat across Google, Meta and TikTok, with the first-party data staying under the retailer's controls when it is activated.
How does contextual targeting work in retail media?
Contextual targeting in retail media works by reading the signals a shopper generates inside the retailer's environment during the current visit and serving the ads that match them. Contextual signals on a retail site include the search query, with its misspellings and partial words; the category page, from broad aisles ("snacks") to narrow ones ("gluten-free crackers"); the product detail page, with its brand, price point, pack size and attributes; and the basket, which shows what the shopper is assembling right now.
Contextual signals also cover shoppers who have declined personalization, and that coverage is the biggest commercial advantage for the retailer: every search and every category view becomes eligible inventory.
In a chocolate aisle, two shoppers may look the same to an open-web profile, both labeled "chocolate lovers". On the retailer's site, one searches "vegan dark chocolate" and the other "fun-size chocolate multipack", and each query brings up different sponsored listings.
In a health category, a search for "magnesium glycinate" signals a focus on sleep or stress. Contextual targeting on that query surfaces bedtime teas and other sleep-support products from the same aisle. Health-category context also lets a retailer serve relevant ads without building a health profile of the person.
Osmos's onsite retail media ad server is built around these signals. The Display Ads app in Osmos lists contextual signals that include smart handling of incomplete keywords, brand detection for conquesting, nearest similar category search, and search context that follows the shopper across pages. Product Ads in Osmos score every impression on behavioral signals such as shopper intent, category, price affinity, brand affinity, cart and purchase history, alongside the advertiser's bid, so the live query and the shopper's record are weighed in the same auction.
Keyword expansion at BigBasket
The search query is the contextual signal with the most direct link to ad revenue, because advertisers bid on keywords. Searches on keywords that no advertiser bids on earn the retailer no ad revenue. In Osmos's work with BigBasket, personalized Ads Ops banner nudges recommended relevant keywords to advertisers, and 37 keywords were influenced through those nudges. Where advertisers placed bids on the recommended keywords, BigBasket recorded ₹37L in total influenced revenue between September and October 2025, and expanded keyword adoption drove 8% overall revenue growth for BigBasket. The full account is in the BigBasket keyword expansion story.
Which targeting should a retailer lead with on each placement?
A retailer should lead with contextual targeting on search-led and category-led placements and with behavioral targeting on placements where the shopper is known but has not yet stated intent.
- Search results pages: lead with the query. The shopper has declared intent, and the ad that matches the query is the most relevant one available. Behavioral signals can break ties between eligible ads.
- Category pages: lead with the category, then refine with history. A shopper in the coffee aisle who always buys decaf should see decaf first.
- Product detail pages: lead with the product's context, such as complementary items, alternatives at a similar price and brand conquesting where the retailer allows it. Product Display Ads in Osmos pick products per impression from purchase history, cart state, browsing and category affinity, so one campaign can show different products to different shoppers on the same page.
- Homepage and app landing screens: lead with behavior for logged-in shoppers, because there is no query yet. Fall back to seasonal and trending context for new visitors.
- Cart and checkout: lead with basket context. What is in the cart is the strongest short-term signal on the site.
- Offsite audience extension: behavior leads by definition, since the shopper is on another platform and the retailer's purchase-based audience is the signal.
- In-store screens: in-store retail media is targeted by day, time and store, such as dairy promotions before noon or soft drinks on weekend afternoons, and the screen shows the same ad to whoever is standing in front of it.
How do retailers combine contextual and behavioral targeting?
Retailers combine the two by letting context decide which ads are eligible for a slot and letting behavior decide the order among them. A shopper searching "shampoo" makes every shampoo ad eligible; their history of buying a sulfate-free brand moves sulfate-free options up.
The most useful bridge between the two is RFM segmentation, which many retailers underuse. RFM stands for recency (how recently a shopper bought in a category), frequency (how often) and monetary value (how much they usually spend). RFM is a behavioral signal, drawn from purchase history, that retailers apply inside the current context: it changes what a shopper sees on the page they are already on.
Take two shoppers browsing protein shakes. Both are in the same category context. RFM shows that one buys monthly and chooses premium brands, while the other buys every few months and waits for discounts. On the same page, the first sees a premium brand's new flavor and the second sees a value pack. The same split works in the chocolate aisle: a monthly premium buyer who often purchases gifts sees premium gift boxes, and an occasional household snack buyer sees fun-size packs. RFM splits like these are especially valuable for grocery retailers managing replenishment cycles, fashion and beauty retailers handling seasonal demand, and food delivery platforms predicting repeat orders.
Combining signals also improves the result for the advertiser. Advertisers renew their campaigns when the targeting produces orders. Machine-learning models apply these signals across every impression (AI-driven targeting in retail media), and each signal a retailer adds to the profile (enriching first-party data) gives that ranking more to work with.
Why does a retailer have an edge over open-web contextual and behavioral targeting?
A retailer has an edge because it owns the strongest version of both signals: typed purchase intent for context and recorded transactions for behavior, all collected on its own site without third-party cookies.
Three assets give a retailer that edge:
- Purchase data. A retailer knows what was bought, how often and at what price, which is a firmer signal than pages read or videos watched.
- Typed on-site search context. A query on a retail site is a shopping instruction. It sits at the moment of purchase, which is why advertisers compete for search placements.
- Closed-loop sales attribution. The same retailer that served the ad records the sale, so it can show an advertiser which signal produced orders.
Commerce audiences are built from transactions. No independent study has settled whether they perform better than audiences built from page topics or social engagement. For a brand whose goal is sales, a signal that comes from sales is the most direct, which is the argument behind commerce media as a category. For the retailer, it means its first-party data in retail media is the targeting layer that makes its media placements worth a premium, onsite and offsite.
How do privacy rules treat contextual and behavioral targeting?
Privacy rules generally treat contextual targeting more lightly, because it reads content, while behavioral targeting on personal data falls under profiling and consent rules in most major markets.
- Page context runs without personal data. IAB UK's 2021 definition states that contextual advertising does not rely on personally identifiable information. A retailer can serve ads on the query and the page to every visitor.
- GDPR (European Union). Article 4(4) defines profiling as "any form of automated processing of personal data" used to evaluate aspects of a person, and Article 4(11) defines consent as "any freely given, specific, informed and unambiguous indication" of the person's wishes (GDPR Art. 4). Behavioral targeting on a known shopper is profiling and needs a lawful basis, in practice usually consent.
- CCPA (California). The California Attorney General's guidance explains that "sharing refers specifically to sharing for cross-context behavioral advertising, which is the targeting of advertising to a consumer based on the consumer's personal information obtained from the consumer's online activity across numerous websites", and consumers can ask businesses to stop sharing (California Attorney General, CCPA). A common reading is that a retailer targeting shoppers on its own site with its own data is not using activity across other websites, but how the definition applies to a given setup, especially when audiences go offsite, is a question for counsel.
- DPDP (India). The Digital Personal Data Protection Rules were notified in November 2025, with compliance phased over about 18 months and a requirement for clear consent notices that specify purposes (Mondaq, 2026).
- Browsers. Google said on 22 April 2025 that it would "maintain our current approach to offering users third-party cookie choice in Chrome" (Google Privacy Sandbox, April 2025). On 17 October 2025 Google said it had "decided to retire" a set of Privacy Sandbox technologies, including Topics and Protected Audience, the browser-based interest and remarketing APIs (Google Privacy Sandbox, October 2025).
On its own site, a retailer can run both approaches without third-party cookies. Contextual signals need no personal data, and behavioral signals come from the retailer's own consented relationship with the shopper. The retailer still decides how far to personalize against shopper privacy and how openly to show shoppers why an ad appeared.
How should a retailer measure which signal earns more?
A retailer should measure contextual and behavioral targeting by splitting traffic on the same placement and comparing revenue per thousand impressions for the retailer and ROAS for the advertiser, with sales tied back to the ad. Click-through rate shows initial engagement, and revenue per thousand impressions and ROAS show whether those clicks turned into orders.
To test which signal earns more, a retailer splits traffic on one placement at a time, such as the first sponsored slot on search results or the homepage carousel, and runs a contextual-led and a behavior-led version for the same advertisers and products. Revenue per thousand impressions shows which earns the retailer more from the same inventory, and advertiser ROAS and new-to-brand sales show which keeps brands renewing. A holdout, where possible, shows the advertiser the incremental sales the ads added.
The measurement only works when ad exposure and orders sit in the same system. Osmos's Display Ads app reports closed-loop to onsite views, add-to-cart and orders, at campaign, inventory and creative level, so advertisers can tie sales to the ad (closed-loop attribution in retail media).
Frequently asked questions
Where does behavioral retargeting fit in retail media?
Retargeting is the narrowest form of behavioral targeting: it shows a shopper an ad for a product they viewed or left in their cart. On a retailer's own site it works best with a short window and a stop rule, so the ad ends once the shopper buys the item or buys a substitute. Offsite, it is one of the audiences a retailer can extend to social and search platforms, measured against orders on the retailer's site.
Is contextual targeting the same as keyword targeting?
No. Keyword targeting covers only the words a shopper types. Contextual targeting is wider, so an advertiser can reach shoppers who never typed a query, such as someone who went straight from the homepage into the frozen aisle, because the aisle itself is the context.
Is contextual targeting the same as audience targeting?
No. Audience targeting picks the shopper first, from a segment such as lapsed coffee buyers, and shows the ad wherever that shopper turns up. Contextual targeting picks the slot first and shows the ad to whoever is there. In retail media most audiences are built from purchase history, so audience targeting on a retail site is a form of behavioral targeting.
What counts as a contextual category in retail media?
A contextual category in retail media is a node in the retailer's own product taxonomy, such as "dairy > yogurt > Greek yogurt". That catalog is a finer-grained map of shopping intent than a publisher's content taxonomy, with its broad categories such as "food and drink", which is why advertisers can target narrow aisles and specific attributes on a retail site.
How long should behavioral signals be kept for targeting?
It depends on the purchase cycle of the category. Fast-moving grocery items may need only a few weeks of history to predict the next purchase, while furniture or electronics signals can stay relevant for months. A retailer should set lookback windows per category, decay older signals and stay within the retention period stated in its privacy notice.
What should a retailer require when comparing contextual or behavioral targeting vendors?
A retailer should require that a platform can read both typed intent and purchase history in the same auction, run on first-party data without third-party cookies, apply consent settings automatically, and report results closed-loop to orders. It should also check whether the platform can run the retailer's audiences offsite under the retailer's own control and whether it handles misspelled and partial queries. Keyword coverage is a revenue lever in its own right, as BigBasket's keyword expansion result shows.
Turn shopper intent into ad revenue
To see how Osmos's onsite and offsite apps read both signals on a retailer's own inventory, book a demo with Osmos.
Sources
- IAB UK, "Contextual Targeting: The key terms", 24 September 2021. iabuk.com
- Kwon, Nyilasy, King and Reid, "Putting Things into Context: A Meta-Analysis of Media Context Effects on Attitudinal Outcomes", Journal of Advertising, 2021, via University of Georgia Grady College. grady.uga.edu
- GDPR, Article 4, Definitions. gdpr-info.eu
- California Attorney General, "California Consumer Privacy Act (CCPA)", updated 28 August 2026. oag.ca.gov
- Mondaq, "From Draft To Reality: Key Changes In India's DPDP Rules 2025", April 2026. mondaq.com
- Google Privacy Sandbox, "Next steps for Privacy Sandbox and tracking protections in Chrome", 22 April 2025. privacysandbox.google.com
- Google Privacy Sandbox, "Update on Plans for Privacy Sandbox Technologies", 17 October 2025. privacysandbox.google.com
Apps in this story
Suggested reading
Your monetization potential
See what's above your ceiling.
Your score, your peer benchmark, and the levers that close the gap.






