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?