How can I set up key values on my site?

Configure Header to Use Key-Values

  1. In the header configuration, below enabled_slots, you should define the below code example.
  2. Make sure to be using the freestar.queue.
  3. The first value that gets set is the Key. The Key is defined by Freestar and should not be modified.
  4. The second value is the Value that will be passed along to DFP. You are able to send through one or more values. Check with your account manager on formatting for the values, as some need to be specific to match what we have in our system.
    1.  If you pass more than one value, it must be in an array and the values need to be in string format. Below are examples of this.
freestar.queue.push(function() {
// More than one value
googletag.pubads().setTargeting('pagetype', ['add value here', ' value 2', 'value 3']);
// One value only
googletag.pubads().setTargeting('Category', ['Transportation']);
});
  1. The Value section must be populated by the website. This is traditionally done dynamically. A good example is passing Tag values, where Tag is the Key and the Values are populated by what’s set on the article.
    1. For example, an article about dogs and cats might have two Tags: “Dogs” and “Cats”. Since those are usually set when the editor writes the article, you should be able to populate the Values with that data.
  2. Below is a list of invalid characters that cannot be passed in the value field. Note: Spaces are acceptable in the value field.
    1. ” (double quotes)
    2. ‘ (apostrophe)
    3. = (equal sign)
    4. ! (exclamation point)
    5. + (plus sign)
    6. # (pound sign)
    7. * (asterisk)
    8. ~ (tilde)
    9. ; (semicolon)
    10. ^ (caret)
    11. () (parentheses)
    12. < > (angle brackets)
    13. [ ] (square brackets)
    14. , (comma)
    15. & (ampersand)

Complete Header Example

Below is an example of what the header section of your code should look like when using key values.

<script data-cfasync="false" type="text/javascript">
var freestar = freestar || {};
freestar.hitTime = Date.now();
freestar.queue = freestar.queue || [];
freestar.config = freestar.config || {};
freestar.debug = window.location.search.indexOf('fsdebug') === -1 ? false : true;

// Tag IDs set here, must match Tags served in the Body for proper setup
freestar.config.enabled_slots = [
"ad_tag_1",
"ad_tag_2"
];

freestar.queue.push(function() {
googletag.pubads().setTargeting("PostID","43724");
googletag.pubads().setTargeting("Category",['DOTW', 'Editors Pick', 'Featured', 'Interviews', 'Web Designers', ]);
});

!function(a,b){var c=b.getElementsByTagName("script")[0],d=b.createElement("script"),e="https://a.pub.network/sitename";e+=freestar.debug?"/qa/pubfig.min.js":"/pubfig.min.js",d.async=!0,d.src=e,c.parentNode.insertBefore(d,c)}(window,document);
</script>