2.0.0 • Published 6 months ago

@attraqt/activity v2.0.0

Weekly downloads
23
License
MIT
Repository
github
Last release
6 months ago

@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

MethodArgument(s)ResultDescription
initoptions: ActivityInitOptionsvoidInitializes the activity client
sendactivity: Activity \| Activity[], options?: SendActivityOptionsPromise<Response>Sends the activity
setUseruser: UservoidSets the user to be sent along with future activities
clearUservoidClears the previously set user
addUserIdentityidentityRepository: string, identity: stringvoidSets a user identity
setUserIdentitiesidentities: {[identityRepository: string]: string}voidSets user identities
addUserSegmentsegment: stringvoidAdds a segment to the user
setUserSegmentssegments: string[]voidSets user segments
addUserTraittrait: string, traitValue: stringvoidAdds a trait to the user
setUserTraitstraits: {[trait: string]: string}voidSets user traits
getUserClustersPromise<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