Skip to content

Commit

Permalink
CM-732. Make the way the page URL is collected configurable (#109)
Browse files Browse the repository at this point in the history
* Add functions to scrape url based on the config

* Add url scraping logic to paramExtractors

* Add tests

* Fix failing integration test

* Stop using URL class not supported by IE

* Fix failing integration test

* Group url extractors and remove repeated parsing and filtering

* Stop using flat(), since it is not supported in older browsers

* Rename page to path

* Document new params and config values

* Small fixes to docs
  • Loading branch information
leonelcuevas authored Mar 9, 2023
1 parent 1632145 commit 194e1be
Show file tree
Hide file tree
Showing 11 changed files with 20,140 additions and 21 deletions.
4 changes: 4 additions & 0 deletions COLLECTOR_PARAMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
- contains the `config.trackerName`
### `pu`
- the url on which the event happened, which is populated by the `page` enricher
### `pu_rp`
- a flag that signals when the path of the event url was not collected, it can appear when the `config.urlCollectionMode` config parameter is set to `no_path`.
### `pu_rqp`
- a list of the query parameters that were removed from the event url, based on the `config.queryParametersFilter` config parameter.
### `refr`
- the url of the referrer, which is populated by the `page` enricher
### `ae`
Expand Down
28 changes: 28 additions & 0 deletions CONFIGURATION_OPTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,3 +233,31 @@ Example:
globalVarName: "liQ2"
}
```

##### `urlCollectionMode` [Optional]

This parameter defines the way LiveConnect collects the event url. It has 2 possible values:

- `full`: the full url is collected with no changes.
- `no_path`: the path part of the url is ignored. Only the domain part will be collected.

The default mode, in case a valid value is not provided, is `full`

Example:
```javascript
{
urlCollectionMode: "no_path"
}
```

##### `queryParametersFilter` [Optional]

This parameter allows to define a regular expression which can be used to restrict the collected query parameters.
Any parameter name that matches the regular expression will not be collected. For example `queryParametersFilter: "^(foo|bar)$"` will block any query parameters named `foo` or `bar`, and only collect the remaining ones.

Example:
```javascript
{
queryParametersFilter: "^(foo|bar)$"
}
```
Loading

0 comments on commit 194e1be

Please sign in to comment.