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.

The syntax rules are:

  • 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 that is 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:

  • Use the simplified JavaScript format for the value, and use the prefix jsvar for the JavaScript variable:<cm:pageview extraparms="jsvar:jsExtraParamValue"/>