Segmentation is a powerful tool that gives you the ability to target ads by customizable key+value pairs passed from within the ad code to the ad server. Depending on your needs, segmentation values can be hard coded into the ad tag or added programmatically. Below we'll step through a basic example.
Segmentation requires an additional parameter be added to your Pro ad tag. The standard BSA Pro ad code looks something like this:
<div id="bsap_405" class="bsaPROrocks" data-serve="CKSI4"></div>
Segmentation requires a'data-segment-key="value"'attribute be added, where "key" and "value" are customizable. For example, say you want to be able to target a "Technology" category on your site. The ad tag would look something like this:
<div id="bsap_405" class="bsaPROrocks" data-serve="CKSI4" data-segment-category="technology"></div>
The "key" here is "category" and "technology" is "value".
Note, if you're looking for a more advanced set up or have questions please see the Q&A section below.
Now that your ad code is set up with the proper 'data-segment-key="value"' attribute you can move to Pro and start targeting ads against it. Below we'll run through a basic set up using the aforementioned 'category=technology' segment:
Q. What if I need to target more than one segment?
A. You can have multiple ''data-segment-key="value"' ' attributes in your ad tag. For example:
<div id="bsap_405" class="bsaPROrocks" data-serve="CKSI4" data-segment-category="technology" data-segment-author="johnsmith" data-segment-tag="tutorials"></div>
Once your ad tag is set up you can then select from those different segments in Pro when setting up or editing an ad. Note, when an ad tag has multiple segments they are treated as "OR" by the ad server.
Q. Can my segment contain multiple values?
A. Yes, values just need to be separated by semi-colons. For example, say you have a 'tag' segment that can contain multiple values. The set up in the ad code may look like this:data-segment-tag="tag1;tag2;tag3". Note, the last value does not need a trailing semi-colon.
Q. Can my keys and/or values contain spaces, underscores or dashes?
A. Nope. At this time they should only contain alphanumbic strings (e.g. a-z, A-Z and 1-9).
Q. Are there any limits to the number of segments I can have?
A. Yes, right now you can have, at most, 15 segments in each ad tag. For example:
<div id="123" data-segment-A="one;two;three" data-segment-B="four;five" data-segment-C="six"></div>
In this example you've definied a total of 6 of 15 segments.
<div id="456" data-segment-A="one;two;three" data-segment-two="another"></div>
Here you have a total of 4 out of 15 segments.