I have a situation where I have two trackers in my application and I need to be able to use activity tracking for one tracker in certain scenarios, but not in others.
Is there any way I can dynamically turn off activity tracking after it has been passed to the client on initialization?
It’s not terribly easy to tell from the docs, but I found this API definition in the repo, which clarifies that you can pass a list of tracker names to enableActivityTracking the same way you can for the track methods.
// @public
export function enableActivityTracking(configuration: ActivityTrackingConfiguration, trackers?: Array<string>): void;
If you pass the array, only the tracker names in the array will have activity tracking enabled. Hope that helps.
(Edit: I started writing, got sidetracked, and Miranda had already beaten me to it by the time I pressed post )
Hmm, ok thanks for the feedback everyone. Not sure I can exactly do what I want in this instance since I want to have activity tracking on for both trackers at a certain point but turn it off at another. Thanks anyways
Hi everybody,
we run into a similar issue on a single page application. We want to enable activity tracking just on certain pages / sub directories. Since there is no disableActivityTracking function, we need to build a cumbersome workaround.
Maybe the reason is not so obvious: but on SPAs you need to initialize the tracker only once. If the first tracker initialization (initial page load) happens on a page where ActivityTracking should be enabled, it will be enabled on all subsequent pages.
bottom line: In my opinion, there should be a disableActivityTracking function.
To clarify this behaviour - when you disable activity tracking and then enable it again, should it resume from where it previous left off or reset entirely and start counting again from 0?
I just scanned the activity tracking docs an came across the following:
“Activity tracking will be disabled if either minimumVisitLength or heartbeatDelayis not integer. This is to prevent relentless callbacks.”
Since the github issue for disableActivityTracking feature is still open: would it be a possible (hacky) solution to set e.g. heartbeatDelay to a string and thereby deactivate ActivityTracking?
“Activity tracking will be disabled if either minimumVisitLength or heartbeatDelayis not integer. This is to prevent relentless callbacks.”
From a quick look, this is no longer relevant in the latest versions. (After 3.1.1). Did you manage to reproduce it in the latest versions ?
Sorry for the delay. Hopefully we can get it released in the next couple of weeks, since it has been requested multiple times. We would be really happy if you want to add any feedback in the issue that you might want us to take into consideration on the design of the functionality.