Target: Cookie Contents
Use this target in web activities to target customers whose current session has a cookie from the site that contains certain values. We can personalize content in an e-Marketing Spot according to the customer's cookie values.Cookies are pieces of text that consist of a name and value that the site can place on each customer's computer to store information about that customer. Your store's developers determine what type of cookies the store uses. Some cookies can store data that can prove useful in personalizing a customer's experience on the store.
Example
You have an advertisement to display on your home page, but only to customers who live in the city of Phoenix, Arizona. These customers have a ZIP code that begins with the numbers 850. Your site is configured to store ZIP codes in a cookie. For example, a customer from Phoenix, Arizona has a cookie that looks like this:ZIPCODE 85032
We can then set up the following web activity:
When a customer views the e-Marketing Spot on the home page: If the customer has a cookie that contains a ZIP code that begins with 850, then display the advertisement for customers who live in the city of Phoenix.
Prerequisites for using this target
- Make sure that the site is configured to support the Management Center marketing features.
- Make sure that your cookies are set on a previous request as they cannot be read if they are part of the current request processing.
- Discuss with a store developer the following issues:
- Your site must use cookies that store the information to use to target specific types of customers. In the previous ZIP code example, the site must gather customers' ZIP codes and store them in a cookie. It is up to the store's developers to determine how to gather our customers' information. To ensure that the Cookie Contents target can match a customer's cookie values, check with developers that the cookie values we want to target are URL encoded and follow these rules:
- Cookie values cannot contain ampersands (&) or commas even if they are encoded. These characters are reserved for internal use by the marketing services.
As a best practice, developers can use URL encoding to encode all other special characters in cookie values, that is, any characters that are not letters or numbers. For example, encode semi-colons as %3B, spaces as %20, and the percent sign (%) as %25.
- Cookie values cannot contain leading or trailing spaces. In Management Center, when you enter the value to match, the software trims any leading or trailing spaces from your entry. Therefore, there is no way to match a cookie value with leading or trailing spaces.
- A store developer must add some lines of code to the JSP file for the e-Marketing Spot used in the web activity. The lines of code pass the specified cookie name and value to the marketing services for evaluation when a customer views the page containing the e-Marketing Spot. The marketing services look for a matching cookie name and value to determine whether to display your targeted content. For instructions, see Modifying the e-Marketing Spot JSP file to support the Cookie Contents target.
Guidelines for using this target
When we are setting up this target:
- We can specify only one cookie name to match, but we can specify one or more values.
- We can specify that the server must match the exact cookie value, a portion of the value, or any value.
- Alternatively, we can target customers who do not have the cookie criteria that you specify.
Related concepts
Activity building blocks: triggers, targets, and actions
Targets in marketing activities
Related tasks
Creating a web activity