2.0.0 • Published 6 months ago
@attraqt/activity v2.0.0
@attraqt/activity
Installation and Usage
npm install --save @attraqt/activity
import {activity} from @attraqt/activity
activity.init({
trackerKey: "YOUR_TRACKER_KEY",
region: "WEBSITE_REGION" // optional, set to EU by default
});
activity.setUser({
identities: {
sessionid: "YOUR_SESSION_ID"
},
traits: {
birthday: "2020-04-01"
},
segments: ["segment1"]
});
activity.send({
action: "view",
target: {
product: "YOUR_PRODUCT_ID"
}
});
Methods
Method | Argument(s) | Result | Description |
---|---|---|---|
init | options: ActivityInitOptions | void | Initializes the activity client |
send | activity: Activity \| Activity[] , options?: SendActivityOptions | Promise<Response> | Sends the activity |
setUser | user: User | void | Sets the user to be sent along with future activities |
clearUser | void | Clears the previously set user | |
addUserIdentity | identityRepository: string , identity: string | void | Sets a user identity |
setUserIdentities | identities: {[identityRepository: string]: string} | void | Sets user identities |
addUserSegment | segment: string | void | Adds a segment to the user |
setUserSegments | segments: string[] | void | Sets user segments |
addUserTrait | trait: string , traitValue: string | void | Adds a trait to the user |
setUserTraits | traits: {[trait: string]: string} | void | Sets user traits |
getUserClusters | Promise< Clusters> | get the user clusters |
2.0.0
6 months ago
1.8.1
6 months ago
1.8.3
6 months ago
1.8.3-alpha.0
6 months ago
1.7.1
1 year ago
1.7.0
1 year ago
1.5.1
2 years ago
1.5.1-alpha.1
2 years ago
1.5.1-alpha.0
2 years ago
1.5.0
3 years ago
1.4.1
3 years ago
1.4.0
3 years ago
1.3.1
3 years ago
1.3.0
4 years ago
1.3.0-alpha.3
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago
1.0.0-alpha.4
4 years ago
1.0.0-alpha.0
4 years ago
0.0.1
4 years ago