Sending background hits

 

Utility of identification

Identification enables you to distinguish hits sent following direct usage of your application from hits sent in the background, automatically and independently of the user, with the help of a BackgroundWorker for example.

 

Tagging

The tracker possesses a Context object, which possesses a property, BackgroundMode. This is BackgroundMode-type enumeration.

By default, this property is set to Normal. In all cases of tagging automatic behaviours independent of the user, it should be set to Task.

To tag these types of operations, you must initialise a new tracker within your class in the case of a Service.

In the case of a BackgroundWorker, it is recommended to use a dedicated instance of the tracker. Should you wish to use a single instance of the tracker, please remember to reset the property to Normal at the end of the BackgroundWorker execution.

 

Tagging examples

  1. Tagging an BackgroundWorker with a dedicated tracker
  2. Tagging an BackgroundWorker with a global tracker
Was this post helpful?
Yes
No
Last update: 29/10/2015