Follow

How to use EAS_pageviewid for different tag types (live from release version 3.19.12.01)

To let Cxense Display know which request belongs to which page, the publisher needs to insert unique pageviewids in the tags. So the parameter ;pageviewid= should be added to all ad request calls that are on the same page in order to safely identify one page load from another, which in turn is used to get more correct inclusivity/exclusivity behavior.

The new functionality in EAS_tag.1.0.js simplifies use of the pageviewid parameter in the content unit tags.

The new EAS_tag.1.0.js adds two new features:

  • A function EAS_uuid() that can be called at any time to generate an RFC 4122 version 4 compliant uuid. This is a string of semi-random characters that should never be repeated twice and is therefore ideal to use as a pageviewid.
  • A global variable EAS_pageviewid that is automatically assigned using the EAS_uuid() function on the first loading of EAS_tag.1.0.js (loading it multiple times on the same page will not change the value). In most situations, this variable can be used directly as the pageviewid value.

It is possible at any time to re-assign EAS_pageviewid to a new value, e.g. a new uuid value returned by calling EAS_uuid(). A possible scenario how this might be useful is if a web page wants to “reset” inclusivity/exclusivity functionality to show the same sets of ads in more than one place.

 

Use of EAS_pageviewid for different tag types

 
 

Composed javascript and Friendly Iframes

The EAS_pageviewid value will automatically be used by Friendly Iframe and Composed JavaScript tags if the page does not already generate and use its own pageviewid implementation.

 

JavaScript, Iframe and Image tags

When using regular JavaScript tags, Iframe tags or Image tags combined with inclusivity/exclusivity, the pageviewid parameter should be generated by your server when the page is served to the visitor.

If this is not possible - for example because your web page isn't generated dynamically - the best solution is to switch to Friendly Iframes or Composed javascript.

Optionally you are able to alter the content unit tags using JavaScript to draw them. For instance a JavaScript content unit tag like this:

<script type="text/javascript" src="http://adserver/eas?cu=123;cre=mu;js=y;target=_blank"></script>

Could be rewritten to:

<script type="text/javascript">
document.write('<scr'+'ipt type="text/javascript" src="http://adserver/eas?cu=123;cre=mu;js=y;target=_blank;pageviewid='+EAS_pageviewid+'"></scr'+'ipt>');
</script>

Or in a version without document.write:

<script type="text/javascript">
var script = document.createElement("script"); script.type = "text/javascript"; script.src = "http://adserver/eas?cu=123;cre=mu;js=y;target=_blank;pageviewid=" + EAS_pageviewid; document.body.appendChild(script);
</script>

Iframe and image tags could be done in a similar way, provided that you have EAS_tag.1.0.js loaded above them.

Example with Iframe tags:

<iframe src="http://eas4.emediate.eu/eas?cu=XXXXX;cre=mu;target=_blank" width="300" height="250" scrolling="no" frameborder="0" marginheight="0" marginwidth="0">
</iframe>

Could be rewritten to:

<script type="text/javascript">
document.write('<iframe src="http://eas4.emediate.eu/eas?cu=XXXXX;cre=mu;target=_blank;pageviewid='+EAS_pageviewid+' " width="300" height="250" scrolling="no" frameborder="0" marginheight="0" marginwidth="0"></iframe>');
</script>

These examples are workarounds for the limitations with the chosen tag types on web pages that are not generated dynamically. They introduce extra complexity and our recommendation is to switch to a supported tag type.

Have more questions? Submit a request

Comments

Powered by Zendesk