Introduced in Feature Pack 3

Syntax for passing JavaScript variables as extra parameters

You can pass a JavaScript variable as an extra parameter to any of the tags for IBM Digital Analytics, formerly known as Coremetrics Analytics. However, the syntax that you use for the extraparms values differs according to your feature pack level.

The syntax rules are:

  • Feature Pack 4Feature Pack 3 You must use properly escaped JavaScript for the extraparms values.
  • Feature Pack 5 or later You can use the simplified JavaScript format for the extraparms values, but you must use the prefix jsvar for the JavaScript variable.

Example

Consider the following JavaScript snippet:
<script type="text/JavaScript">
var jsExtraParamValue = "abc_123";
</script>

This snippet defines a JavaScript variable named jsExtraParamValue that has a value of abc_123. If you want to pass the value to the IBM Digital Analytics tags, use the syntax that applies to your feature pack level as demonstrated in these examples:

  • Feature Pack 4Feature Pack 3 Use properly escaped JavaScript for the value:<cm:pageview extraparms=\"jsExtraParamValue\" />
  • Feature Pack 5 or later Use the simplified JavaScript format for the value, and use the prefix jsvar for the JavaScript variable:<cm:pageview extraparms="jsvar:jsExtraParamValue" />