GovoltePlugin

The Govolte plugin sends events to the Govolte collector.

Usage

Create and configure the plugin as follows:

The newGovoltePlugin method supports the following optional configuration properties:

  • maxRetryCount: number: Max number of retries before ditching an event. For example, if you set it to 3 then it will do 4 trials. Value should be between 0 and 10. Defaults to 3.
  • delayBetweenRetriesInMs: number: Number of ms between each retry call. It will be multiplied by the retry count so calls retry with exponential back-off. Value should be between 0 and 30_000. Defaults to 5_000.
  • delayBetweenStreamWaypointsInMs number: Number of milliseconds between streamWaypoint events. Other stream-related events will also reset this interval. Value should be between 0 and 30_000. Defaults to 30_000.
  • baseUrl: string: Destination url to which events will be sent. Defaults to https://topspin.npo.nl.
// Accept all defaults
const govoltePlugin = newGovoltePlugin();

// Modify configuration
const govoltePlugin = newGovoltePlugin({
  maxRetryCount: 5,
  delayBetweenRetriesInMs: 10_000,
  delayBetweenStreamWaypointsInMs: 5_000,
  baseUrl: 'https://my.custom.domain.com',
});

The newGovoltePlugin method supports the following optional configuration properties:

  • maxRetryCount: number: Max number of retries before ditching an event. For example, if you set it to 3 then it will do 4 trials. Value should be between 0 and 10. Defaults to 3.
  • delayBetweenRetriesInMs: number: Number of ms between each retry call. It will be multiplied by the retry count so calls retry with exponential back-off. Value should be between 0 and 30_000. Defaults to 5_000.
  • delayBetweenStreamWaypointsInMs number: Number of milliseconds between streamWaypoint events. Other stream-related events will also reset this interval. Value should be between 0 and 30_000. Defaults to 30_000.
  • baseUrl: string: Destination url to which events will be sent. Defaults to https://topspin.npo.nl.

e.g.

// Accept all defaults
const govoltePlugin = newGovoltePlugin();

// Modify configuration
const govoltePlugin = newGovoltePlugin({
  maxRetryCount: 5,
  delayBetweenRetriesInMs: 10_000,
  delayBetweenStreamWaypointsInMs: 5_000,
  baseUrl: 'https://my.custom.domain.com',
});

The GovoltePlugin plugin should be included within the plugins when creating the shared NPOTag instance.

  • endpoint: URL: Destination url to which events will be sent. If not set, defaults to https://topspin.npo.nl/mob-event

Create the GovoltePlugin accepting default URL

let govoltePlugin = GovoltePlugin()

Or specifying your custom URL

let url = URL(string: "https://my.custom.domain.com")!
let govoltePlugin = GovoltePlugin(endpoint: url)

Finally, add the created plugin when setting your shared NPOTag instance

NPOTag.configure(
  withSharedContext: sharedContext,
  plugins: [
    govoltePlugin
  ]
)

GovoltePlugin should be created by PluginsFactory (see example below)

  • pluginContext: Object provided by PluginsFactory
  • baseUrl: Destination url to which events will be sent
NpoTag.builder()
    //...
    .withPluginsFactory { pluginContext ->
        setOf(
            GovoltePlugin(
                pluginContext = pluginContext,
                baseUrl = "https://topspin.npo.nl/",
            )
        )
    }

Stored values (Cookies/LocalStorage/Application storage)

KeyDescription of value
_dvpThe ID generated for this browser, used to understand usage patterns over multiple visits
_dvsThe Session ID, used to understand usage patterns within a browser session
_cs_fpidAn ID set in the browser, always set but only used when a visitor participates in NMO DAM research panels

Starting from Version 2.2.0, the Web SDK values are no longer stored in cookies and use LocalStorage instead. These keys are prefixed with npotag_

Plugin-specific fields

The following fields are inferred by the sdk and only used by the GovoltePlugin.

p: party_id (string)

A unique identifier used to track anonymous user activity between sessions. This is stored for max 2 years after the last visit. This value is logged if debug is true.

s: session_id (string)

A unique identifier used to track a single session. A new identifier is generated on initialization or after 30 minutes of inactivity.

n: isNewParty (boolean as char)

Indicates that the party_id was newly generated in this session.

f: isFirstInSession (boolean as char)

Indicates that an event is the first one sent with the current session id. This should only be true for one event per session.

v: pageViewId (string)

A unique identifier for the page view related to the page context.

e: eventId (string)

A unique identifier of the event, formed by appending an auto-incrementing integer to the pageViewId.

j: screenHeight (base36 encoded number)

The height of the user’s screen.

i: screenWidth (base36 encoded number)

The width of the user’s screen.

k: devicePixelRatio (base36 encoded number)

The pixel ratio of the user’s device.

h: windowHeight (base36 encoded number)

[Web only] The height of the browser window.

w: windowWidth (base36 encoded number)

[Web only] The width of the browser window.

screenOrientation (string)

The current orientation of the user’s device. NOTE: On web, this has the following possible values: portrait-primary, portrait-secondary, landscape-primary, landscape-secondary. The value is taken from the screen orientation api if supported, otherwise it tries the window.orientation api (i.e. on mobile safari). If neither of these are supported, the value is naively inferred by comparing screenWidth to screenHeight.