Implementation
Events
egViewegUseregUserLoginegUserSignupegFundegBetslipItemActionegBetslipSummaryegBetslipTransactionSummaryegBetslipItemTransactionegGamePlayegInteractionegBetSettle

Qubit event reference

This section documents the full specification of Qubit's QProtocol events.

On the left, you can filter by your site's vertical, and also choose to only show fields that are recommended for the particular products you are intending to use.

Use the Optional tickbox to show those events that we recommend adding in a more advaned QProtocol implementation.

Don't forget that we have a number of vertical-specific setup guides, which you can find in our Setup section, along with guides on mobile set up and CMS integrations.

For more information on how to setup Qubit's UV library for emitting events, you can refer to our setup documentation.

egView

The egView event reports a page view and is a special event because it is required by smartserve.js for data collection and processing. It is therefore essential that every page emits an egView event and that it is emitted before any other event.

DANGER: Any events emitted before the first egView event are considered invalid. Web and mobile applications emit view events whenever a view is rendered.

Fields
  • languagestring
    The language used in this view. Must be an IETF language code
  • countrystring
    The selected country for the view. Must be an ISO Alpha 2 code
  • currencystring
    The ISO 4217 currency code for the user, e.g. GBP, USD
uv.emit('egView', {
  language: 'en-us',
  country: 'US',
  currency: 'USD'
})

egUser

The egUser event is emitted once per view and reports visitor metadata. The event should be emitted on every page as long as there is data available for the user.

For many websites, the event will be present and well populated when the visitor logs on. Websites with a newsletter subscription form that the visitor has previously submitted, might be able to populate the name and email address for the visitor using the data collected on form submission.

WARNING: It is acceptable to emit hashed user Ids but be aware that to ingest data for use in Qubit's platform, the user Ids in the provided dataset must be hashed in the same way.

Fields
  • user.idstring
    A unique user Id. Can also be a hash of the username and/or email address
uv.emit('egUser', {
  user: {
    id: '2861102bace6e6620948564f0ce0a7cd'
  }
})

egUserLogin

Emitted when a user logs in.

Fields
  • user.idstring
    A unique user Id. Can also be a hash of the username and/or email address
  • typestring
    Type of log in
uv.emit('egUserLogin', {
  user: {
    id: '2861102bace6e6620948564f0ce0a7cd'
  },
  type: 'Logging in on a phone app using touch id.'
})

egUserSignup

Emitted when a user signs up for e.g. a newsletter or event.

Fields
  • user.idstring
    A unique user Id. Can also be a hash of the username and/or email address
  • The user's primary email address
  • typestring
    The type of sign up e.g. newsletter or event
  • namestring
    A meaningful name unique to the sign up
uv.emit('egUserSignup', {
  user: {
    id: '2861102bace6e6620948564f0ce0a7cd',
    email: 'john@johnsmith.com'
  },
  type: null,
  name: null
})

egFund

Emitted when a user makes an action that affects the status of that user's funds.

Fields
  • user.idstring
    A unique user Id. Can also be a hash of the username and/or email address
  • The user's primary email address
  • typestring
    The description of the action. Can be deposit or withdrawal
uv.emit('egFund', {
  user: {
    id: '2861102bace6e6620948564f0ce0a7cd',
    email: 'john@johnsmith.com'
  },
  type: 'deposit'
})

egBetslipItemAction

Emitted for every interaction with the betslip, using the action field to specify whether a line item was added or removed.

Fields
  • Unique betslip Id
  • The total stake of the betslip, rounded to 2 decimal places
  • Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Please refer to our setup docs for more specific details for each vertical and event
  • The ISO 4217 currency e.g. GBP, USD
  • The number of items in the betslip
  • The total cost of the betslip after the application of taxes, discounts, promotions, etc, rounded to 2 decimal places
  • Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Please refer to our setup docs for more specific details for each vertical and event
  • The ISO 4217 currency e.g. GBP, USD
  • The price of the betslip line item after discounts, rounded to 2 decimal places
  • Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Please refer to our setup docs for more specific details for each vertical and event
  • The ISO 4217 currency e.g. GBP, USD
uv.emit('egBetslipItemAction', {
  betslip: {
    id: null,
    totalStake: {
      value: 9.99,
      currency: 'USD'
    },
    quantity: null,
    total: {
      value: 9.99,
      currency: 'USD'
    }
  },
  bet: {
    price: {
      value: 9.99,
      currency: 'USD'
    }
  }
})

egBetslipSummary

Emitted for each time the basket is visible to the visitor either as an inline minibasket or in a view that shows only the basket. If the visitor's basket is changed in any way, the summary is emitted again.

Fields
  • Unique betslip Id
  • The total stake of the betslip, rounded to 2 decimal places
  • Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Please refer to our setup docs for more specific details for each vertical and event
  • The ISO 4217 currency e.g. GBP, USD
  • The number of items in the betslip
  • The total cost of the betslip after the application of taxes, discounts, promotions, etc, rounded to 2 decimal places
  • Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Please refer to our setup docs for more specific details for each vertical and event
  • The ISO 4217 currency e.g. GBP, USD
uv.emit('egBetslipSummary', {
  betslip: {
    id: null,
    totalStake: {
      value: 9.99,
      currency: 'USD'
    },
    quantity: null,
    total: {
      value: 9.99,
      currency: 'USD'
    }
  }
})

egBetslipTransactionSummary

Emitted each time a user transacts.

Fields
  • Unique betslip Id
  • The total stake of the betslip, rounded to 2 decimal places
  • Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Please refer to our setup docs for more specific details for each vertical and event
  • The ISO 4217 currency e.g. GBP, USD
  • The number of items in the betslip
  • The total cost of the betslip after the application of taxes, discounts, promotions, etc, rounded to 2 decimal places
  • Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Please refer to our setup docs for more specific details for each vertical and event
  • The ISO 4217 currency e.g. GBP, USD
  • An Id unique to the transaction
uv.emit('egBetslipTransactionSummary', {
  betslip: {
    id: null,
    totalStake: {
      value: 9.99,
      currency: 'USD'
    },
    quantity: null,
    total: {
      value: 9.99,
      currency: 'USD'
    }
  },
  transaction: {
    id: '83748372'
  }
})

egBetslipItemTransaction

Emitted for every line item within a transaction.

Fields
  • Unique betslip Id
  • The total stake of the betslip, rounded to 2 decimal places
  • Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Please refer to our setup docs for more specific details for each vertical and event
  • The ISO 4217 currency e.g. GBP, USD
  • The number of items in the betslip
  • The total cost of the betslip after the application of taxes, discounts, promotions, etc, rounded to 2 decimal places
  • Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Please refer to our setup docs for more specific details for each vertical and event
  • The ISO 4217 currency e.g. GBP, USD
  • The price of the betslip line item after discounts, rounded to 2 decimal places
  • Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Please refer to our setup docs for more specific details for each vertical and event
  • The ISO 4217 currency e.g. GBP, USD
  • An Id unique to the transaction
uv.emit('egBetslipItemTransaction', {
  betslip: {
    id: null,
    totalStake: {
      value: 9.99,
      currency: 'USD'
    },
    quantity: null,
    total: {
      value: 9.99,
      currency: 'USD'
    }
  },
  bet: {
    price: {
      value: 9.99,
      currency: 'USD'
    }
  },
  transaction: {
    id: '83748372'
  }
})

egGamePlay

Represents a bet in a virtual game.

Fields
  • Describes a unique identifier for the virtual game.
  • game.namestring
    Describes a unique name for the virtual game.
  • game.typestring
    Describes the type of the virtual game.
  • The amount the user wants to play.
  • Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Please refer to our setup docs for more specific details for each vertical and event
  • The ISO 4217 currency e.g. GBP, USD
  • The Id of the gameplay event.
uv.emit('egGamePlay', {
  game: {
    gameId: '1234',
    name: 'Rainbow Riches',
    type: 'slots'
  },
  playValue: {
    value: 9.99,
    currency: 'USD'
  },
  gamePlayId: 'A12e3'
})

egInteraction

Emitted to track visitor interaction for certain elements on the page. These events are not emitted for all interactions on all elements, only those that are of interest.

Fields
  • typestring
    The interaction type e.g. click, view, hover, download, share.
  • namestring
    A meaningful name unique to the event.
uv.emit('egInteraction', {
  type: null,
  name: null
})

egBetSettle

Emitted when a bet is settled.

Fields
  • bet.betIdstring
    A unique Id to identify the bet
  • The price of the betslip line item after discounts, rounded to 2 decimal places
  • Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Please refer to our setup docs for more specific details for each vertical and event
  • The ISO 4217 currency e.g. GBP, USD
  • returnprice
    The bet return if won
  • Depending on the context, this could be the value of the basket, product, package, total, subtotal, discount, shipping, item, game, bet, etc. Please refer to our setup docs for more specific details for each vertical and event
  • The ISO 4217 currency e.g. GBP, USD
uv.emit('egBetSettle', {
  bet: {
    betId: null,
    price: {
      value: 9.99,
      currency: 'USD'
    }
  },
  'return': {
    value: 9.99,
    currency: 'USD'
  }
})