Skip to main content
Cookie Groups

This article describes how to use cookie groups.

M
Written by Marcus Johansson
Updated over a week ago

Cookie Groups is a concept in BidTheatre that could serve as a general storage unit for user data.

Inserting Cookie Group Data via script Tags

Let's say for instance that you on a site know the hair color and eye color of a certain user and wish to funnel this user data to BidTheatre ASX for future targeting use. To start sending user data to ASX you will generate a tracker invocation script (from the Tracker Invocations-tab) and at page render time replace the corresponding values to match the current user. The base script without replacements would in this case look like this:

<!-- /* Cookie Group - User Data */ -->
<!-- /* BidTheatre Cookie Group Invocation Script v1.1 */ -->
<!-- /* Place this cookie group script as the first element in the body tag on the page you want to track. */ --><script type="text/javascript" src="https://adsby.bidtheatre.com/js/asx_track.min.js"></script>
<script>
asxtrack.config = {
cookieGroupId: 49,
keys: ["e","h"],
values: ["[e]","[h]"]
};

asxtrack.callCookieGroup();
</script>

Assuming your cookie group dictionary specifies green eye color with the value 1 and brown hair with the value 3, the script would look like this after replacements.

<!-- /* Cookie Group - User Data */ -->
<!-- /* BidTheatre Cookie Group Invocation Script v1.1 */ -->
<!-- /* Place this cookie group script as the first element in the body tag on the page you want to track. */ --><script type="text/javascript" src="https://adsby.bidtheatre.com/js/asx_track.min.js"></script>
<script>
asxtrack.config = {
cookieGroupId: 49,
keys: ["e","h"],
values: [1,3]
};

asxtrack.callCookieGroup();
</script>

Storing Data Sets

The delimiter # can be used in the value of a cookie group key to store and maintain a set of values in the key. Each value can then be targeted individually. A GET request with the same key specified multiple times can be used to insert several values to a set. The parameter "ap=1" can be used to define whether the values should be appended to the existing set of a key. Default is to overwrite the key contents with the given values in the request.

Set values have the following limits:

  • Maximium length of an individual set component is 40 characters. Longer components are discarded, not truncated.

  • Maximum number of set components is 50. If the number of components exceed this, new components are kept and old components are discarded.

Matching Tree Values

The delimiter | can be used in the value of a cookie group to define that matching on the value will not need to be exact - a prefix of the stored value will be enough. This can be used to set up a category taxonomi. For example, say that we store

key

value

description

cat

123

Automotive

cat

123|123-2

Automotive - Buses

cat

123|123-1

Automotive - Cars

cat

123|123-1|123-1-1

Automotive - Cars - Volvo

cat

123|123-1|123-1-2

Automotive - Cars - SAAB

Targeting a campaign on the "Automotive - Cars" key-value pair will also target all subcategories, without them having to be explicitly targeted in the campaign.

With the cookie group dictionary, you specify a readable meaning to specific keys and values that you collect in your cookie group.

Follow the "Edit Group Items"-link from Advertisers / Cookie Groups to start setting up your dictionary. You can now assign a key, value and description for each possible key-value pair. See an example below of how the case discussed above would be setup. Available eye colors would in this example be green, brown and blue and available hair colors would be blonde, black and brown. How you name your keys and values is completely up to you and it doesnt matter if they are text-based or numeric.


โ€‹

Did this answer your question?