AudienceManager Tricks of the Trait
As an Adobe AudienceManager (AAM) user, you are already familiar with the “trait,” which is the most granular data point in the platform. Once you are comfortable with Trait Builder basics, you can perform a few new tricks to take your data collection to medal-worthy levels.
Real-time data collection happens through event calls (HTTP requests), which contain a multitude of detailed page- and visit-level information in the form of query string key-value pairs. Most of your traits are built off these query string parameters (props, evars, events, etc.), but on every event call there is another chunk of data contained in the HTTP request header. You can use the header field to build traits as well.
One interesting way to segment users based on their HTTP request header information is to use the Accept-Language field. On any request from a browser, this field tells the webserver which language the visitor prefers. In return, the webserver responds with the webpage text in the correct language. When building traits with HTTP request headers, the name of the header is always the key, but you must start it with “h_” — for example, “h_accept-language.” This prefix tells AAM to inspect the HTTP header in the request.
As an example, try creating a trait named “Spanish Speakers.” Use the logic h_accept-language startswith ‘es’ to put folks into this trait when their first language preference is Spanish (“es” is for “Espanol”).
Building out additional rules requires some easily obtained knowledge of HTTP headers and their values (follow the link for more information). A couple of other common request headers are h_referer (to segment users based on all or part of the URL they visit) and h_user-agent (to segment users based on their browser/device).
Note: h_referer can easily be confused with c_referrer. The latter is an Adobe Analytics variable that sets the referring (previous) page URL, where h_referer passes the actual page the visitor is on. Note again that the h_ prefix tells AAM to inspect the header, while the c_ prefix tells AAM to inspect the query string.
Test HTTP Header
When building traits using HTTP header information, sometimes it is helpful to test your logic. Once you have your logic setup, open Chrome and navigate to your site. Choose one of the “demdex.net” event calls in Chrome’s developer tools (network tab) and select “headers.” Next, select and copy the entire block under “request headers.” You can paste this straight into the “Test HTTP Headers” section of Trait Builder. If your logic matches, you’ll get a pop-up telling you so.
Sometimes, when a simple “equals,” “greater than,” or “contains,” won’t do, matchesregex can save the day. Let’s say you are a large retailer, and you have a variable that is passing in several values delimited by a pipe, like so:
Let’s assume that “electronics” is the page/product category, “tablet” is the sub-category, and “7009” is the product number (SKU) of a specific tablet model. Let’s also assume that all tablets are in the “7000” range, and you’d like to create a trait consisting of visitors browsing any/all tablets. You can create the trait with the following logic:
Tablet Visitor Trait: c_evar21 matchesregex .*0007[0-9][0-9][0-9]$
This will match on a string that contains “0007” (and anything before it, because “.” is any character and “*” is “any number of times”), followed by exactly three digits, each with a range from 0–9, and nothing after it (designated by the “$”). This assumes that the SKU is always the last value in evar21, which will match any SKUs ranging from 0007000 to 0007999.
There are many readily available resources if you’d like to learn more about regular expressions.
Test Event URL
When you have advanced trait rules such as the one above, it can be helpful to test your logic. You can do so in the Trait Builder UI under “Test Event URL.” Simply place the HTTP call you’d like to test against your trait logic (or make one up) and hit “test.” AudienceManager will tell you whether or not the event call would put a user into that trait.
Geo Data Traits
Although we generally recommend targeting visitor geos in the targeting platform itself, AAM also lets you segment and analyze users based on their location. You can choose from the following levels of detail:
- Country (example: d_country = usa)
- Region (example: d_state = il)
- City (example: d_city = chicago)
- Metro (example: d_metro = 602)
- Latitude (example: d_latitude > 41 AND d_latitude
- Longitude (example: d_longitude −88)
If you’d like to setup geo traits or need help with any of the concepts explained above, please contact your AudienceManager Consultant.