diff --git a/CHANGELOG.md b/CHANGELOG.md index e151291..e3b4dc5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.0.6] 2022-07-25 + +### Added + +- `source` property for some methods, for events tracking + ## [1.0.5] 2022-07-19 ### Updated diff --git a/DOCUMENTATION.md b/DOCUMENTATION.md index bcd7054..07ae548 100644 --- a/DOCUMENTATION.md +++ b/DOCUMENTATION.md @@ -194,6 +194,7 @@ | payload.step | Operation | |

Workflow step

| | payload.input | Object | |

Sample user input

| | [payload.environment] | string | "production" |

Specifiy execution environment (production or staging). Optional. Default value production.

| +| [payload.source] | string | |

The source of event for tracking purposes. Optional.

| @@ -210,6 +211,7 @@ | payload.step | Operation |

Workflow step

| | payload.input | Object |

Sample user input

| | [payload.environment] | string |

Specifiy execution environment (production or staging). Optional. Default value production.

| +| [payload.source] | string |

The source of event for tracking purposes. Optional.

| @@ -397,6 +399,7 @@ | [payload.hutk] | string |

The tracking cookie token value used for HubSpot lead activity tracking. You can retrieve this value from the "hubspotutk" cookie placed in the user's browser by the HubSpot JavaScript Tracking Code. (optional)

| | [payload.pageName] | string |

The name or title of the page the submission happened on (optional)

| | [payload.ipAddress] | string |

The IP address of the visitor filling out the form (optional)

| +| [payload.trackSource] | string |

The source of event for tracking purposes (optional)

| diff --git a/package.json b/package.json index 9bfb47a..c0fb60f 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "1.0.5", + "version": "1.0.6", "license": "MIT", "main": "dist/index.js", "typings": "dist/index.d.ts", diff --git a/src/classes/Connector.ts b/src/classes/Connector.ts index fc71316..c36bff0 100644 --- a/src/classes/Connector.ts +++ b/src/classes/Connector.ts @@ -200,16 +200,19 @@ class Connector { * @param {Operation} payload.step - Workflow step * @param {Object} payload.input - Sample user input * @param {string} [payload.environment=production] - Specifiy execution environment (`production` or `staging`). Optional. Default value `production`. + * @param {string} [payload.source] - The source of event for tracking purposes. Optional. * @returns {Promise} Promise object with action execution payload */ async testAction({ step, input, environment, + source, }: { step: Operation; input: unknown; environment?: string; + source?: string; }): Promise { if (!this.token) { throw new Error('Authentication required'); @@ -226,6 +229,7 @@ class Connector { step, input, environment: environment || 'production', + source: source || 'unknown', }, this.token ); @@ -239,16 +243,19 @@ class Connector { * @param {Operation} payload.step - Workflow step * @param {Object} payload.input - Sample user input * @param {string} [payload.environment] - Specifiy execution environment (`production` or `staging`). Optional. Default value `production`. + * @param {string} [payload.source] - The source of event for tracking purposes. Optional. * @returns {Promise} Promise object with action execution payload */ async runAction({ step, input, environment, + source, }: { step: Operation; input: unknown; environment?: string; + source?: string; }): Promise { if (!this.token) { throw new Error('Authentication required'); @@ -265,6 +272,7 @@ class Connector { step, input, environment: environment || 'production', + source: source || 'unknown', }, this.token ); diff --git a/src/classes/User.ts b/src/classes/User.ts index b94b247..9bfd729 100644 --- a/src/classes/User.ts +++ b/src/classes/User.ts @@ -147,6 +147,7 @@ class User { * @param {string} [payload.hutk] - The tracking cookie token value used for HubSpot lead activity tracking. You can retrieve this value from the "hubspotutk" cookie placed in the user's browser by the HubSpot JavaScript Tracking Code. (optional) * @param {string} [payload.pageName] - The name or title of the page the submission happened on (optional) * @param {string} [payload.ipAddress] - The IP address of the visitor filling out the form (optional) + * @param {string} [payload.trackSource] - The source of event for tracking purposes (optional) * @returns {Promise} Promise object with `true` on success */ async requestEarlyAccess({ @@ -160,6 +161,7 @@ class User { hutk, pageName, ipAddress, + trackSource, }: { email: string; source?: string; @@ -171,6 +173,7 @@ class User { hutk?: string; pageName?: string; ipAddress?: string; + trackSource?: string; }): Promise { if (!this.token) { throw new Error('Authentication required'); @@ -194,6 +197,7 @@ class User { hutk: hutk || '', pageName: pageName || '', ipAddress: ipAddress || '', + trackSource: trackSource || 'unknown', }, this.token );