URL Fragment Tracking Plugin
Custom handling for url fragments, even if they violate the RFC for fragments
Example URLs with fragments (anchors) http://www.test.com/index.html?p1=1#test?p2=2,p3=3
In the above URL, the URL fragment is #test?p2=2,p3=3
the parameter p1 belongs to the URL and p2/p3
belong to the fragment. The tag should not send p2/p3
when following the RFC for fragmented URLs. This plugin allows the Client to change the behavior to send the fragment parameters depending on their requirements.
Note: When the Anchor click tracking is enabled, the rules defined here will be applied to the dl=21
hit that is sent by the anchor click event.
Plugin options
The plugin is loaded with the following properties available to be set via the configuration object:
Parameter | Description | Data Type | Default Value |
---|---|---|---|
paramHandling
|
1. None - Fragment parameters are not handled 2. Add Prefix - Adds 'fragment' or the text as defined by the "Parameter Prefix" setting to the parameter. Eg #test?p1=1 will add fragment=1 to the message 3. Add No Prefix - dSends the fragment parameter as a standard parameter. Eg. |
Text | addPrefix |
prefix
|
Defines the prefix to use when the parameter handling method is set to 'Add Prefix' above. | Text | anchor |
addAnchorName
|
Add an anchor name parameter to the message. 1. None 2. Name - Adds the name of the Anchor to a parameter 3. Full Fragment - Adds the full fragment string to the parameter 'wt.anchor_name' |
Text | name |
virtualPageView
|
When set to true, a virtual page view is created when a page is loaded with a URL fragment. | Boolean | FALSE |
virtulDl
|
Sets the parameter value for wt.dl for a virtual page view event. Allows only numeric values. |
Numeric | 26 |
applyClickEventOnly
|
When set to true, only anchor click events are captured, and wt.dl is set to 21. |
Boolean | FALSE |
blockCollect
|
This option forces the Oracle CX Tag to wait until the plugin loads before data collection can begin. | Boolean | TRUE |
Usage example
This example will prefix the fragment parameters with "anchor=1", and send the parameters as WT.name=[fragment parameters].
{
"virtualPageView": false,
"prefix": "anchor",
"blockCollect": true,
"virtialDl": 26,
"paramHandeling": "addPrefix",
"addAnchorName": "name",
"applyClickEventOnly": false,
"enable": false
}