Skip to content

Commit

Permalink
chore: add notes re: cid and uid relationship;
Browse files Browse the repository at this point in the history
- Closes #14
  • Loading branch information
lukeed committed Jan 29, 2020
1 parent 361beef commit 914f2bf
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ganalytics.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,20 @@ declare module "ganalytics" {

/**
* The application or site owner's known identifier for the user.
* @note This becomes required if `cid` is not defined.
* @see https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#uid
* @example 'as8eknlll', 'foobar'
*/
uid?: string;

/**
* The application or site owner's generated identifier for the client device.
* @note This becomes required if `uid` is not defined.
* @see https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cid
* @example 'as8eknlll', 'foobar'
*/
cid?: string;

/**
* Control the session duration. The session will begin or end with this hit.
* @see https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#sc
Expand Down
22 changes: 22 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ Type: `String`

Your Google Analytics tracker ID; eg `UA-XXXXXXXX-X`

#### options
Type: `Object`

Any common, [general options](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#general) that this instance should hold onto.

> **Note:** Any `option` key can be redefined or overwritten within a `send()` call.
#### options.aip
Type: `Integer`<br>
Default: `0`
Expand All @@ -69,6 +76,21 @@ Type: `String`

Specifies the application verison. See [Application Version](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#av).


#### options.cid
Type: `String`

Anonymously identify a particular user, device, or browser instance. This should be persisted so that repetitive session use the same identifier. See [Client ID](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#cid).

> **Important** This is required when `options.uid` is not defined.
#### options.uid
Type: `String`

An identifier for a known user, if possible. This value should never be persisted. See [User ID](https://developers.google.com/analytics/devguides/collection/protocol/v1/parameters#uid).

> **Important** This is required when `options.cid` is not defined.
#### options.ds
Type: `String`

Expand Down

0 comments on commit 914f2bf

Please sign in to comment.