@piwikpro/react-piwik-pro
Advanced tools
Comparing version
{ | ||
"name": "@piwikpro/react-piwik-pro", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "Piwik PRO tracking library for ReactJS", | ||
@@ -5,0 +5,0 @@ "author": "Piwik Pro Integration Team <integrations@piwik.pro>", |
283
README.md
@@ -125,4 +125,6 @@ | ||
- [ClientConfiguration](#modulesclientconfigurationmd) | ||
- [ContentTracking](#modulescontenttrackingmd) | ||
- [CookieManagement](#modulescookiemanagementmd) | ||
- [CrossDomainTracking](#modulescrossdomaintrackingmd) | ||
- [CustomDimensions](#modulescustomdimensionsmd) | ||
@@ -134,2 +136,3 @@ - [CustomEvent](#modulescustomeventmd) | ||
- [GoalConversions](#modulesgoalconversionsmd) | ||
- [Heartbeat](#modulesheartbeatmd) | ||
- [PageViews](#modulespageviewsmd) | ||
@@ -227,2 +230,43 @@ - [SiteSearch](#modulessitesearchmd) | ||
<a name="modulesclientconfigurationmd"></a> | ||
## ClientConfiguration | ||
### Table of contents | ||
- [getDomains](#getdomains) | ||
- [setDomains](#setdomains) | ||
#### getDomains | ||
▸ **getDomains**(): `Promise`\<`string`[]\> | ||
Returns list of internal domains (set with "setDomains" function and used in outlink tracking). | ||
##### Returns | ||
`Promise`\<`string`[]\> | ||
___ | ||
#### setDomains | ||
▸ **setDomains**(`domains`): `void` | ||
Allows to define a list of internal domains or mobile app URIs. Used in outlink tracking for determining whether a link is an outlink and in cross domain linking for determining which links should have visitor ID parameter injected. | ||
##### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `domains` | `string`[] | | ||
##### Returns | ||
`void` | ||
<a name="modulescontenttrackingmd"></a> | ||
@@ -622,2 +666,168 @@ | ||
<a name="modulescrossdomaintrackingmd"></a> | ||
## CrossDomainTracking | ||
### Table of contents | ||
#### Type Aliases | ||
- [LinkDecorator](#linkdecorator) | ||
- [VisitorIdGetter](#visitoridgetter) | ||
- [customCrossDomainLinkDecorator](#customcrossdomainlinkdecorator) | ||
- [customCrossDomainLinkVisitorIdGetter](#customcrossdomainlinkvisitoridgetter) | ||
- [disableCrossDomainLinking](#disablecrossdomainlinking) | ||
- [enableCrossDomainLinking](#enablecrossdomainlinking) | ||
- [getCrossDomainLinkingUrlParameter](#getcrossdomainlinkingurlparameter) | ||
- [isCrossDomainLinkingEnabled](#iscrossdomainlinkingenabled) | ||
- [setCrossDomainLinkingTimeout](#setcrossdomainlinkingtimeout) | ||
### Type Aliases | ||
#### LinkDecorator | ||
Ƭ **LinkDecorator**: (`url`: `string`, `value`: `string`, `name`: `string`) => `string` \| ``null`` | ||
##### Type declaration | ||
▸ (`url`, `value`, `name`): `string` \| ``null`` | ||
###### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `url` | `string` | | ||
| `value` | `string` | | ||
| `name` | `string` | | ||
###### Returns | ||
`string` \| ``null`` | ||
___ | ||
#### VisitorIdGetter | ||
Ƭ **VisitorIdGetter**: (`url`: `string`, `name`: `string`) => `string` | ||
##### Type declaration | ||
▸ (`url`, `name`): `string` | ||
###### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `url` | `string` | | ||
| `name` | `string` | | ||
###### Returns | ||
`string` | ||
#### customCrossDomainLinkDecorator | ||
▸ **customCrossDomainLinkDecorator**(`decorator`): `void` | ||
Sets custom cross domains URL decorator for injecting visitor ID into URLs. Used when cross domain linking is enabled. | ||
##### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `decorator` | [`LinkDecorator`](#linkdecorator) | | ||
##### Returns | ||
`void` | ||
___ | ||
#### customCrossDomainLinkVisitorIdGetter | ||
▸ **customCrossDomainLinkVisitorIdGetter**(`getter`): `void` | ||
Sets custom cross domain URL parser for extracting visitor ID from URLs. Should extract data injected by URL decorator. The getter should return visitor ID extracted from page URL. | ||
##### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `getter` | [`VisitorIdGetter`](#visitoridgetter) | | ||
##### Returns | ||
`void` | ||
___ | ||
#### disableCrossDomainLinking | ||
▸ **disableCrossDomainLinking**(): `void` | ||
Disables cross domain linking. | ||
##### Returns | ||
`void` | ||
___ | ||
#### enableCrossDomainLinking | ||
▸ **enableCrossDomainLinking**(): `void` | ||
Enables cross domain linking. Visitors across domains configured with "setDomains" function will be linked by passing visitor ID parameter in links. | ||
##### Returns | ||
`void` | ||
___ | ||
#### getCrossDomainLinkingUrlParameter | ||
▸ **getCrossDomainLinkingUrlParameter**(): `Promise`\<`string`\> | ||
Returns the name of a cross domain URL parameter (query parameter by default) holding visitor ID. This is "pk_vid" by default. | ||
##### Returns | ||
`Promise`\<`string`\> | ||
___ | ||
#### isCrossDomainLinkingEnabled | ||
▸ **isCrossDomainLinkingEnabled**(): `Promise`\<`boolean`\> | ||
Returns boolean telling whether cross domain linking is enabled. | ||
##### Returns | ||
`Promise`\<`boolean`\> | ||
___ | ||
#### setCrossDomainLinkingTimeout | ||
▸ **setCrossDomainLinkingTimeout**(`timeout`): `void` | ||
Changes the time in which two visits across domains will be linked. The default timeout is 180 seconds (3 minutes). | ||
##### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `timeout` | `number` | | ||
##### Returns | ||
`void` | ||
<a name="modulescustomdimensionsmd"></a> | ||
@@ -1059,2 +1269,43 @@ | ||
<a name="modulesheartbeatmd"></a> | ||
## Heartbeat | ||
### Table of contents | ||
- [disableHeartBeatTimer](#disableheartbeattimer) | ||
- [enableHeartBeatTimer](#enableheartbeattimer) | ||
#### disableHeartBeatTimer | ||
▸ **disableHeartBeatTimer**(): `void` | ||
Disables sending heartbeats if they were previously enabled by "enableHeartBeatTimer" function. | ||
##### Returns | ||
`void` | ||
___ | ||
#### enableHeartBeatTimer | ||
▸ **enableHeartBeatTimer**(`delays?`): `void` | ||
When a visitor is not producing any events (e.g. because they are reading an article or watching a video), we don’t know if they are still on the page. This might skew page statistics, e.g. time on page value. Heartbeat timer allows us to determine how much time visitors spend on a page by sending heartbeats to the Tracker as long as the page is in focus. | ||
##### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `delays?` | `number`[] | | ||
##### Returns | ||
`void` | ||
<a name="modulespageviewsmd"></a> | ||
@@ -1127,2 +1378,3 @@ | ||
- [deanonymizeUser](#deanonymizeuser) | ||
- [getUserId](#getuserid) | ||
@@ -1133,4 +1385,17 @@ - [getVisitorId](#getvisitorid) | ||
- [setUserId](#setuserid) | ||
- [setUserIsAnonymous](#setuserisanonymous) | ||
#### deanonymizeUser | ||
▸ **deanonymizeUser**(): `void` | ||
Disables anonymous tracking and sends deanonymization event to the Tracker. Recommended method for disabling anonymous tracking. | ||
##### Returns | ||
`void` | ||
___ | ||
#### getUserId | ||
@@ -1202,3 +1467,21 @@ | ||
___ | ||
#### setUserIsAnonymous | ||
▸ **setUserIsAnonymous**(`isAnonymous`): `void` | ||
Enables or disables anonymous tracking (anonymous = without consent). The next emitted event will have anonymous mode set accordingly. | ||
##### Parameters | ||
| Name | Type | | ||
| :------ | :------ | | ||
| `isAnonymous` | `boolean` | | ||
##### Returns | ||
`void` | ||
<a name="modulesecommercemd"></a> | ||
@@ -1205,0 +1488,0 @@ |
36158
18.8%1724
19.64%