Tuesday, January 23, 2007

Behavioral Targeting Hack

So you have read about behavioral targeting and want to get started but are concerned about spending the money on a Behavioral Targeting tool. If that’s the case then continue reading. This article will show you how you can easily deploy behavioral targeting capabilities with minor coding on your site and without spending any money on a tool or engaging a Behavioral Targeting vendor.

Below I have outlined the Behavioral Targeting process in simple steps and next I have provided an example. This process is affordable and lets you test the water before you get fully engaged in Behavioral Targeting.

1. Identify the user segment that you want to target e.g. “In market auto buyers” – You can also build a monetization model. Monetization model is not necessary but allows you to prioritize and determine what segments make sense. I am not going to get into details of how to build a monetization model in this article; you can contact me if you need help with building the monetization models.
2. Identify what content views (behaviors) will determine the segments. Eg. Users who have viewed 2 or more pages related to auto loans.
3. Determine what content, message or product you want to show to users who fall in those segments. e.g. A banner ad targeted to this segment.
4. Build a capability in your code to read/write a cookie as user views the content that defines the segment. e.g. Write a cookie every time user views the auto loan related page.
5. Write the unique identifier in the cookie when a user falls in that segment. This identifier will let you know which users fall in which segments. E.g. as soon as user has viewed 2 auto loan related pages, write a cookie (say segmentid)
6. Build a capability in your pages to read a cookie and then serve contents based on the cookie value as users continues to browse the site or comes back for a repeat visit.
7. Create reports in your analytics tool based on segmentid cookie to see the behavior of your users who are in that segment. This helps you better understand your target segments.


This is an online bank and wants to target those users who are in market to buy a car.

1. I want to target users who are in market for car loan. I will call this segment “In market auto Buyers” and I will give them segment an id of CAR001 (a unique identifier)
2. A user who views at least 2 pages the car loan section or starts a loan process funnel but does not complete it will be identified as the “In Market Auto Buyer”. How did I determine how many pages or what pages will put a user in this segment? I made it up. How you determine what defines a user segment will depend on your particular business and goals.
3. I want to show my target users a banners and links which will prompt them to fill the auto loan application (loan process funnel).
4. We will need 3 cookies, one to keep track of how many pages user has viewed in the determined section (autoloanpgs), the other to keep track of the segment users falls in (if you want to create multiple segments than you can add those to this cookie) (segmendid), and a third one to make sure you do not target a user even if the user falls in the segment (segmentdonotrget). Third cookie ensure that you do not target the user once a user has been targeted and completes the intended action
5. As soon as user views a page in this section,
a. Read the cookie called “segmentdonotrget”, if this cookie has a value of CAR001 do nothing, you do not want to target this customer. You are done.
b. Read the cookie called “segmentid”, if this cookie exists and has value of CAR001 then, you don’t need to track this user any more, this user is already in your target segment. Go to step 6.
c. Read a cookie called “autoloanpgs”, if it exists increment the value by 1 else write the cookie with a value of 1. (The idea is to increment this cookie with a value for each page view within “Auto Loans” section). If the value is 2 or above write the cookie “segmentid” with a value of “CAR001” (Note if you are using multiple segment then you can use the same method but will have to delimit the values by a , or some other character)
6. On every page of the site read “segmentid” cookie and if you target segment “CAR001” exists then serve ads or links to “Auto Loan” to these users.
7. Once the user completes the auto loan process, write the segment id in “segmentdonotrget” so that you do not target this user again.

I have tried my best to explain this process. If anything is not clear then please do write to me and I will make sure to clarify it in this article.


  1. Anil, that's a fantastic approach and something many of us could execute with a bit of developer help. Will have to give it a try.


I would like to hear your comments and questions.