Sending background hits

  • iOS
  • watchOS
  • tvOS
 

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 background fetch or a background task for example.

 

Tagging

The tracker possesses a context property, which possesses a subproperty, backgroundMode. This is BackgroundMode-type enumeration.

By default, this property is set to Normal. In the case of background fetch tagging, the property must be set to Fetch, and in all other cases of tagging automatic behaviours independent of the user, it should be set to Task.

To tag these types of functioning, it is recommended to use an instance of a dedicated tracker. If you wish to use just one tracker instance, you must remember to reset the property to Normal at the end of execution of background fetch or background task.

 

Tagging examples

  1. Tagging background fetch with a dedicated tracker

  2. Tagging background fetch with a global tracker

  3. Tagging a background task with a dedicated tracker

  4. Tagging a background task with a global tracker

Was this post helpful?
Yes
No
Last update: 13/12/2016