Web setup for eGaming

This is for:

Developer

In this article, we’ll walk you through the steps you need to take to get Qubit set up on your site for Experimentation Hub clients working in the egaming vertical.

Who should use this guide?

This guide is recommended for Experimentation Hub clients looking to implement our Smartserve script (required to drive basic data collection) and those essential QProtocol events required to drive experiences, segmentation, and analytics.

Don’t forget to checkout our Events page for the full QP event specification.

Setup tasks

Perform these tasks in the following order:

  1. Add the UV API script

  2. Add the Smartserve script

  3. Emit events

Add the UV API script

Add on every page:

<script>
!function(){function n(){function n(n){p.level=n}function e(n,e){p.info(n,'event emitted'),e=c(e||{}),e.meta=e.meta||{},e.meta.type=n,u.push(e),r(),v.listeners=f(v.listeners,function(n){return!n.disposed})}function o(n,e,o){function r(){return p.info('Replaying events'),t(function(){s(v.events,function(t){c.disposed||l(n,t.meta.type)&&e.call(o,t)})}),f}function i(){return p.info('Disposing event handler'),c.disposed=!0,f}p.info('Attaching event handler for',n);var c={type:n,callback:e,disposed:!1,context:o||window};v.listeners.push(c);var f={replay:r,dispose:i};return f}function t(n){p.info('Calling event handlers'),a++;try{n()}catch(n){p.error('UV API Error',n.stack)}a--,r()}function r(){if(0===u.length&&p.info('No more events to process'),u.length>0&&a>0&&p.info('Event will be processed later'),u.length>0&&0===a){p.info('Processing event');var n=u.shift();v.events.push(n),t(function(){s(v.listeners,function(e){if(!e.disposed&&l(e.type,n.meta.type))try{e.callback.call(e.context,n)}catch(n){p.error('Error emitting UV event',n.stack)}})})}}function i(n,e,o){var t=v.on(n,function(){e.apply(o||window,arguments),t.dispose()});return t}function s(n,e){for(var o=n.length,t=0;t<o;t++)e(n[t],t)}function c(n){var e={};for(var o in n)n.hasOwnProperty(o)&&(e[o]=n[o]);return e}function l(n,e){return'string'==typeof n?n===e:n.test(e)}function f(n,e){for(var o=n.length,t=[],r=0;r<o;r++)e(n[r])&&t.push(n[r]);return t}var u=[],a=0,p={info:function(){p.level>n.INFO||console&&console.info&&console.info.apply(console,arguments)},error:function(){p.level>n.ERROR||console&&console.error&&console.error.apply(console,arguments)}};n.ALL=0,n.INFO=1,n.ERROR=2,n.OFF=3,n(n.ERROR);var v={on:o,emit:e,once:i,events:[],listeners:[],logLevel:n};return v}'object'==typeof module&&module.exports?module.exports=n:window&&void 0===window.uv&&(window.uv=n())}();
</script>

Add the smartserve.js script

Add on every page:

<script src='https://static.goqubit.com/smartserve-<YOUR_PROPERTY_ID>.js' async></script>

Emit events

Events are emitted using the UV API and must conform to a certain schema. Events are emitted using JavaScript, usually on page load or when a new view is rendered on a single page app. An example is shown below:

window.uv.emit('theEventType', {
  aStringField: 'theValueWhichMustBeTheCorrectType',
  aNumberField: 3,
  aBooleanField: false
})

Indicative events by page type

In the following table, we show a breakdown of a site by activity type, alongside the events that could be emitted for that activity. This guide represents a typical set up and there may be exceptions.

Activity Available events

All pages

egView, egUser

Registration

egView, egUser, egSignUp

Login

egView, egUser, egLogin

Deposit

egView, egUser, egFund

Withdrawal

egView, egUser, egFund

Bet Added

egView, egUser, egBetslipItemAction, egBetslipSummary

Bet Placed

egView, egUser, egBetslipTransactionSummary, egBetslipItemTransaction

Game played

egGamePlay

Qubit recommends the following events should be emitted:

These events represent the starting point for setting up Qubit on your site. Additional events are required to drive Qubit’s programmatic experiences.

For an overview of all QProtocol events for the eGaming vertical, see eGaming Events and Types.

For each of the above events, we identify those fields that are required to integrate with Qubit technology. Other Qubit products have different event field dependencies, which will be discussed during onboarding.

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’s therefore essential that every page emits an egView event and that it is emitted before any other event.

Emit egView events on every page.

Warning

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

Required fields:

  • type

  • subtypes

  • language

  • country

  • currency

Example schema

Field (JS Data Type) Description

type (String)

The type of view. Can be one of account, betslip, cashier, confirmation, content, event, game, gametypes, home, listing, promo, registration, search

subtypes (Array of Strings)

An unordered list of subtypes to describe the view (for example, ['Soccer','WorldCup 2018','Qualifications'])

language (String)

The language used in this view. Must be an IETF language tag (for example, en-gb, en-us)

country (String)

The selected country for the view, which must be an ISO 3166-1 alpha-2 code (for example, GB, FR, US)

currency (String)

The ISO 4217 currency code for the user (for example, GBP, USD)

Example JavaScript

uv.emit('egView',{
  type: 'null',
  subtypes: ['Soccer','World Cup 2018','Qualifications'],
  language: 'en-us',
  country: 'US',
  currency: 'USD'
})

Setup guidelines

type

  • Use only lower-case characters

  • Custom names can be used for unique page types that are not covered by our recommended page types such as home, category, product

  • It is acceptable to use null in the absence of a page type

subtypes

  • Where possible, the array should be aligned with the same structure used for the page breadcrumb if available

language, country, currency

  • These fields are only required if your site has multiple languages, currencies, or shipping countries. If not, they can be safely omitted

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 visitor.

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

Can we omit or hash user.email to comply with our internal data privacy policies?

In short, yes. Both user Id and email can be hashed. However, be aware that to ingest data for use in the Qubit platform, the user Id and email in the provided dataset must be hashed in the same way.

Alternatively, you may choose to omit user.email. The omission of a required field does not prevent the event itself from being sent to Qubit and being processed by our data pipeline–you’ll see a validation error in the Validation Dashboard for the event though.

For further information about our role as a data processor and our obligations and commitments under GDPR, refer to Personal Data and in particular How is customer data treated? For legal clarifications, contact Coveo Support.

Emit egUser events on every page.

Required fields:

  • user.id

  • user.title

  • user.firstName

  • user.lastName

  • user.username

  • user.email

  • user.isGuest

  • user.balance

Example schema

Field (JS Data Type) Description

user.id (String)

A unique user Id. Can be a hash of the username and/or email address

user.title (String)

The visitor’s title

user.firstName (String)

The visitor’s first name

user.lastName (String)

The visitor’s surname

user.username (String)

The visitor’s chosen or generated username

user.email (String)

The visitor’s primary email address

user.isGuest (Boolean)

True if the visitor is a guest without a registered account

user.balance.value (Number)

The current balance, rounded to 2 decimal places

user.balance.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

Example JavaScript

uv.emit('egUser',{
  user: {
    id: '20384872',
    title: 'Mr',
    firstName: 'Jack',
    lastName: 'Smith',
    username: 'j_smith1975',
    email: 'j_smith1975@hotmail.com',
    isGuest: false,
    balance: {
      value: 45.00,
      currency: 'GBP',
    },
  }
})

Setup guidelines

user.id

  • It is acceptable to emit a hashed user Id

user.email

  • It is acceptable to emit a hashed email

user.balance

  • user.balance.value must be rounded to 2 decimal places

Examples of rounding

Good examples:

price: {
  value: 55,
  currency: 'USD'
}
price: {
  value: 55.55,
  currency: 'USD'
}

Bad examples:

price: {
  value: 55.555,
  currency: 'USD'
}

egUserLogin

The egUserLogin is emitted once per login and reports metadata for the logged in visitor.

Emit egUserLogin events on login pages.

Required fields:

  • user.id

  • user.title

  • user.firstName

  • user.lastName

  • user.username

  • user.email

  • user.balance

  • firstLogin

  • type

Example schema

Field (JS Data Type) Description

user.id (String)

The visitor’s Id

user.title (String)

The visitor’s title

user.firstName (String)

The visitor’s first name

user.lastName (String)

The visitor’s surname

user.username (String)

The visitor’s chosen or generated username

user.email (String)

The visitor’s primary email address

user.balance.value (Number)

The current balance, rounded to 2 decimal places

user.balance.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

firstLogin (Boolean)

True only if this is the first time the user has logged in

type (String)

The type of login (for example, Touch ID)

Example JavaScript

uv.emit('egUserLogin',{
  user: {
    id: '20384872',
    title: 'Mr',
    firstName: 'Jack',
    lastName: 'Smith',
    username: 'j_smith1975',
    email: 'j_smith1975@hotmail.com',
    balance: {
      value: 45.00,
      currency: 'GBP',
    },
  },
  firstLogin: false,
  type: 'Touch ID'
})

Setup guidelines

user.balance

egUserSignup

The egUserSignup event should be emitted once per signup and reports meta data for the signed-up user.

Emit egUserSignUp events on signup pages.

Required fields:

  • user.id

  • user.title

  • user.firstName

  • user.lastName

  • user.username

  • user.email

  • user.address

  • user.age

  • user.phoneNumber

  • user.balance

  • type

  • name

Example schema

Field (JS Data Type) Description

user.id (String)

The visitor’s Id

user.title (String)

The visitor’s title

user.firstName (String)

The visitor’s first name

user.lastName (String)

The visitor’s surname

user.username (String)

The visitor’s chosen or generated username

user.email (String)

The visitor’s primary email address

user.address.lines (Array of Strings)

An array of address lines NOT including city, region, postcode, or country, maximum of 3 lines allowed

user.address.locality (String)

The signed-up visitor’s town or city

user.address.postalCode (Strxing)

The signed-up visitor’s postal code, zipcode, or country equivalent

user.address.country (String)

The signed-up visitor’s country

user.address.countryCode (String)

The ISO 3166-1 alpha-2 code for the signed up visitor (for example, GB, FR, US)

user.age (Number)

The signed-up visitor’s age in years

user.phoneNumber (String)

The signed-up visitor’s phone number, formatted without spaces and special characters

user.balance.value (Number)

The current balance, rounded to 2 decimal places

user.balance.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

type (String)

What the visitor has signed up for (for example, newsletter or event)

name (String)

A meaningful name unique to the signup

Example JavaScript

uv.emit('egUserSignup',{
  user: {
    id: '2861102bace6e6620948564f0ce0a7cd',
    title: 'Mr',
    firstName: 'John',
    lastName: 'Smith',
    username: 'JohnSmith',
    email: 'john@johnsmith.com',
    address: {
      lines: [
        'Flat 12',
        '123 High Street'
      ],
      locality: 'London',
      region: 'New York',
      postalCode: '10010',
      country: 'United States',
      countryCode: 'US'
    },
    age: 42,
    phoneNumber: '2121234567',
    balance: {
      value: 9.99,
      currency: 'USD'
    },
  },
  type: 'Registration',
  name: 'Registration Success'
  })

Setup guidelines

user.balance

egFund

The egFund event is emitted when a visitor performs an action that affects the status of their funds.

Emit egFund event on pages where a visitor can perform an action that changes their fund status.

Required fields:

  • user.id

  • user.title

  • user.firstName

  • user.lastName

  • user.username

  • user.email

  • user.balance

  • type

  • amount

  • method

Example schema

Field (JS Data Type) Description

user.id (String)

The visitor’s Id

user.title (String)

The visitor’s title

user.firstName (String)

The visitor’s first name

user.lastName (String)

The visitor’s surname

user.username (String)

The visitor’s chosen or generated username

user.email (String)

The visitor’s primary email address

user.balance.value (Number)

The current balance, rounded to 2 decimal places

user.balance.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

type (String)

The action type that prompted the change in the visitor’s funds (for example, deposit)

amount.value (Number)

The amount deposited or withdrawn, rounded to 2 decimal places

amount.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

method (String)

The method used to deposit or withdraw funds

Example JavaScript

window.uv.emit('egFund',{
  user: {
    id: '2861102bace6e6620948564f0ce0a7cd',
    title: 'Mr',
    firstName: 'John',
    lastName: 'Smith',
    username: 'JohnSmith',
    email: 'john@johnsmith.com',
    balance: {
      value: 20.00,
      currency: 'USD'
    },
  },
  type: 'deposit',
  amount: {
    value: 10.00,
    currency: 'USD'
  },
  method: 'PayPal'
})

Setup guidelines

user.balance

amount

egBetslipItemAction

The egBetslipItemAction event is emitted when a visitor interacts with a betslip, for example by adding or removing a bet from a betslip or changing the odds.

Emit egBetslipItemAction events for all interactions with the betslip.

Required fields:

  • betslip.id

  • betslip.totalStake

  • betslip.quantity

  • betslip.discount

  • betslip.totalPotential

  • betslip.totalOdds

  • betslip.subtotal

  • betslip.total

  • bet.betId

  • bet.price

  • bet.potentialReturn

  • bet.odds

  • bet.multiBet

  • bet.receiptId

  • bet.betType

  • bet.inplay

  • bet.sport

  • bet.competition

  • bet.eventName

  • bet.eventId

  • bet.selection

  • bet.selectionId

  • bet.marketName

  • bet.marketId

  • action

Example schema

Field (JS Data Type) Description

betslip.id (String)

Unique betslip Id

betslip.totalStake.value (Number)

The betslip total stake, rounded to 2 decimal places

betslip.totalStake.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.quantity (Number)

The number of items in the betslip

betslip.discount.value (Number)

The amount discounted by vouchers or promotions, rounded to 2 decimal places

betslip.discount.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.totalPotential.value (Number)

The total potential of the betslip based on stake, odds, and bet type, rounded to 2 decimal places

betslip.totalPotential.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.totalOdds (Number)

The total odds of the betslip, expressed as a decimal (for example, 3.0 is the decimal equivalent of 2/1, 4.0 is 3/1)

betslip.subtotal.value (Number)

The total cost of the betslip excluding tax and discounts, rounded to 2 decimal places

betslip.subtotal.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.total.value (Number)

The total cost of the betslip including tax and discounts, rounded to 2 decimal places

betslip.total.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

bet.betid (String)

Unique bet Id

betslip.price.value (Number)

The price of the bet after discounts, rounded to 2 decimal places

betslip.price.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.potentialReturn.value (Number)

The potential return from the betslip, rounded to 2 decimal places

betslip.potentialReturn.currency (Number)

The ISO 4217 currency code, (for example, GBP, USD)

bet.odds (Number)

The total odds of the bet, expressed as a decimal (for example, 3.0 is the decimal equivalent of 2/1, 4.0 is 3/1)

bet.multiBet (Boolean)

True if the bet is part of a multibet

bet.receiptId (String)

Bets from the same multibet will have the same receiptId

bet.betType (String)

The bet type

bet.inplay (String)

True if the bet is currently in play

bet.sport (String)

The name of the sports that has been bet on

bet.competition (String)

The name of the competition that has been bet on

bet.eventName (String)

The name of the event that has been bet on

bet.eventId (String)

The Id of the event that has been bet on

bet.selection (String)

The event selection

bet.selectionId (String)

The event selection Id

bet.marketName (String)

The market name (for example, Match Betting)

bet.marketId (String)

The market name Id

action (String)

What action was taken (for example, add)

Example JavaScript

uv.emit('egBetslipItemAction',{
  betslip: {
    id: '232324434',
    totalStake: {
      value: 25.00,
      currency: 'USD'
    },
    quantity: 1,
    discount: {
      value: 5.50,
      currency: 'USD'
    },
    totalPotential: {
      value: 50.00,
      currency: 'USD'
    },
    totalOdds: 3.0,
    subtotal: {
      value: 50.00,
      currency: 'USD'
    },
    total: {
      value: 9.99,
      currency: 'USD'
    },
  },
  bet: {
    betId: '34343434',
    price: {
      value: 15.00,
      currency: 'USD'
    },
    potentialReturn: {
      value: 50.00,
      currency: 'USD'
    },
    odds: 3.0,
    multiBet: true,
    receiptId: '45454555',
    betType: 'Single',
    inplay: true,
    sport: 'Football',
    competition: 'Barclays Premier League',
    eventName: 'West Ham v Tottenham',
    eventId: 'BPLWHTOTT',
    selection: 'Tottenham',
    selectionId: 'TOTT12345',
    marketName: 'Match Betting',
    marketId: '565656',
  },
  action: 'add'
})

Setup guidelines

  • betslip.totalStake.value, betslip.discount.value, betslip.totalPotential.value, betslip.subtotal.value, betslip.total.value, bet.price.value, bet.potentialReturn.value, discount.value must be rounded to 2 decimal places.

egBetslipSummary

The egBetslipSummary event is emitted each time the visitor interacts with a bet.

Emit egBetslipSummary events on all basket views.

Required fields:

  • betslip.id

  • betslip.totalStake

  • betslip.quantity

  • betslip.discount

  • betslip.totalPotential

  • betslip.totalOdds

  • betslip.subtotal

  • betslip.total

Example schema

Field (JS Data Type) Description

betslip.id (String)

Unique betslip Id

betslip.totalStake.value (Number)

The betslip total stake, rounded to 2 decimal places

betslip.totalStake.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.quantity (Number)

The number of items in the betslip

betslip.discount.value (Number)

The amount discounted by vouchers or promotions, rounded to 2 decimal places

betslip.discount.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.totalPotential.value (Number)

The total potential of the betslip based on stake, odds, and bet type, rounded to 2 decimal places

betslip.totalPotential.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.totalOdds (Number)

The total odds of the betslip, expressed as a decimal (for example, 3.0 is the decimal equivalent of 2/1, 4.0 is 3/1)

betslip.subtotal.value (Number)

The total cost of the betslip excluding tax and discounts, rounded to 2 decimal places

betslip.subtotal.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.total.value (Number)

The total cost of the betslip including tax and discounts, rounded to 2 decimal places

betslip.total.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

Example JavaScript

uv.emit('egBetslipSummary',{
  betslip: {
    id: '232324434',
    totalStake: {
      value: 9.99,
      currency: 'USD'
    },
    quantity: 5,
    discount: {
      value: 9.99,
      currency: 'USD'
    },
    totalPotential: {
      value: 9.99,
      currency: 'USD'
    },
    totalOdds: 3.0,
    subtotal: {
      value: 9.99,
      currency: 'USD'
    },
    total: {
      value: 9.99,
      currency: 'USD'
    }
  }
})

Setup guidelines

  • betslip.totalStake.value, betslip.discount.value, betslip.totalPotential.value, betslip.subtotal.value, betslip.total.value, bet.price.value, bet.potentialReturn.value, discount.value must be rounded to 2 decimal places.

egBetslipTransactionSummary

The egBetslipTransactionSummary event is emitted when a bet is placed. Most importantly, this event is used to count conversions and the associated revenue.

Emit egBetslipTransactionSummary events according to the following logic:

Betslip Contents Number of egBetslipTransactionSummary events emitted

1 single bet

1 event

n singles

1 event

1 multiple

1 event

n multiples

n events

n singles AND n multiples

1 event for singles AND n events for n multiples

Required fields:

  • betslip.id

  • betslip.totalStake

  • betslip.quantity

  • betslip.discount

  • betslip.totalPotential

  • betslip.totalOdds

  • betslip.subtotal

  • betslip.total

  • transaction.id

Example schema

Field (JS Data Type) Description

betslip.id (String)

Unique betslip Id

betslip.totalStake.value (Number)

The amount deposited or withdrawn, rounded to 2 decimal places

betslip.totalStake.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.quantity (Number)

The number of items in the betslip

betslip.discount.value (Number)

The amount discounted by vouchers or promotions, rounded to 2 decimal places

betslip.discount.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.totalPotential.value (Number)

The total potential of the betslip based on stake, odds, and bet type, rounded to 2 decimal places

betslip.totalPotential.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.totalOdds (Number)

The total odds of the betslip, expressed as a decimal (for example, 3.0 is the decimal equivalent of 2/1, 4.0 is 3/1)

betslip.subtotal.value (Number)

The total cost of the betslip excluding tax and discounts, rounded to 2 decimal places

betslip.subtotal.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.total.value (Number)

The total cost of the betslip including tax and discounts, rounded to 2 decimal places

betslip.total.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

action (String)

The action performed on the bet, can be add or remove

transaction.id (String)

Unique transaction Id

Example JavaScript

uv.emit('egBetslipTransactionSummary',{
  betslip: {
    id: '24343434',
    totalStake: {
      value: 9.99,
      currency: 'USD'
    },
    quantity: 1,
    discount: {
      value: 9.99,
      currency: 'USD'
    },
    totalPotential: {
      value: 9.99,
      currency: 'USD'
    },
    totalOdds: 3.0,
    subtotal: {
      value: 9.99,
      currency: 'USD'
    },
    total: {
      value: 9.99,
      currency: 'USD'
    }
  },
  transaction: {
    id: '83748372'
  }
})

Setup guidelines

  • betslip.totalStake.value, betslip.discount.value, betslip.totalPotential.value, betslip.subtotal.value, betslip.total.value must be rounded to 2 decimal places.

egBetslipItemTransaction

The egBetslipItemTransaction event is emitted for every bet within the transacted betslip.

Transaction events are very important because they report revenue for your website.

This event collects granular information about individual items contained within a transaction. It enables segmentation based on betting or gaming preferences, including sport, competition, etc.

Emit egBetslipItemTransaction events for every bet within a transaction.

Required fields

  • betslip.id

  • betslip.totalStake

  • betslip.quantity

  • betslip.discount

  • betslip.totalPotential

  • betslip.totalOdds

  • betslip.subtotal

  • betslip.total

  • bet.betId

  • bet.price

  • bet.potentialReturn

  • bet.odds

  • bet.startTime

  • bet.multibet

  • bet.receiptId

  • bet.betType

  • bet.inplay

  • bet.sport

  • bet.competition

  • bet.eventName

  • bet.eventId

  • bet.selection

  • bet.selectionId

  • bet.marketName

  • bet.marketId

  • action

  • transaction.id

Example schema

Field (JS Data Type) Description

betslip.id (String)

Unique betslip Id

betslip.totalStake.value (Number)

The betslip total stake, rounded to 2 decimal places

betslip.totalStake.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.quantity (Number)

The number of items in the betslip

betslip.discount.value (Number)

The amount discounted by vouchers or promotions, rounded to 2 decimal places

betslip.discount.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.totalPotential.value (Number)

The total potential of the entire betslip (bet return), based on stake, odds, and bet type, rounded to 2 decimal places

betslip.totalPotential.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.totalOdds (Number)

The total odds of the betslip, expressed as a decimal (for example, 3.0 is the decimal equivalent of 2/1, 4.0 is 3/1)

betslip.subtotal.value (Number)

The total cost of the betslip before the application of taxes, discounts, promotions, etc, rounded to 2 decimal places

betslip.subtotal.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.total.value (Number)

The total cost of the entire betslip after the application of taxes, discounts, promotions, etc, rounded to 2 decimal places

betslip.total.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

betslip.subtotalIncludingTax.value (Number)

The total cost of the entire betslip after the application of taxes, but before any discounts, promotions, etc, rounded to 2 decimal places

betslip.subtotalIncludingTax.currency (String)

The ISO 4217 currency, (for example, GBP, USD)

bet.betid (String)

Unique bet Id

bet.price.value (Number)

The price of the bet line item after discounts, rounded to 2 decimal places

bet.price.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

bet.potentialReturn.value (Number)

The potential return from the betslip line item, rounded to 2 decimal places

bet.potentialReturn.currency (String)

The ISO 4217 currency code (for example, GBP, USD)

bet.odds (Number)

The total odds of the bet, expressed as a decimal (for example, 3.0 is the decimal equivalent of 2/1, 4.0 is 3/1)

bet.multiBet (Boolean)

True if the bet is part of a multibet

bet.receiptId (String)

Bets from the same multibet will have the same receiptId

bet.betType (String)

The bet type

bet.inplay (String)

True if the bet is currently in play

bet.sport (String)

The name of the sports that has been bet on

bet.competition (String)

The name of the competition that has been bet on

bet.eventName (String)

The name of the event that has been bet on

bet.eventId (String)

The Id of the event that has been bet on

bet.selection (String)

The event selection

bet.selectionId (String)

The event selection Id

bet.marketName (String)

The market name (for example, Match Betting)

bet.marketId (String)

The market name Id

action (String)

What action was taken (for example, add)

transaction.id (String)

Unique transaction Id

Example JavaScript

uv.emit('egBetslipItemTransaction',{
  betslip: {
    id: '09809809',
    totalStake: {
      value: 30.00,
      currency: 'USD'
    },
    quantity: 2,
    discount: {
      value: 5.00,
      currency: 'USD'
    },
    totalPotential: {
      value: 125.00,
      currency: 'USD'
    },
    totalOdds: 3.0,
    subtotal: {
      value: 40.00,
      currency: 'USD'
    },
    total: {
      value: 30.00,
      currency: 'USD'
    },
  },
  bet: {
    betId: '09809890',
    price: {
      value: 30.00,
      currency: 'USD'
    },
    potentialReturn: {
      value: 100.00,
      currency: 'USD'
    },
    odds: 3.0,
    multiBet: false,
    receiptId: '343434343',
    betType: 'Single',
    inplay: false,
    sport: 'Cricket',
    competition: 'Test Match',
    eventName: 'England v Australia',
    eventId: 'TMENGAUS',
    selection: 'England',
    selectionId: 'ENG00001',
    marketName: 'Match Betting',
    marketId: '343434',
  },
  transaction: {
    id: '83748372',
  },
  action: 'add'
})

Setup guidelines

  • betslip.totalStake.value, betslip.discount.value, betslip.totalPotential.value, betslip.subtotal.value, betslip.total.value, bet.price.value, bet.potentialReturn.value, discount.value must be rounded to 2 decimal places.

egGamePlay

The egGamePlay event is emitted whenever the user successfully places a stake in a game.

Emit egGamePlay events when a bet is placed in a virtual game. The event should include:

Required fields:

  • game.gameId

  • game.name

  • game.type

  • playType

  • playValue

  • platform

  • virtualCurrencyUsed

  • gamePlayId

Example schema

Field (JS Data Type) Description

game.gameId (String)

Unique identifier for the virtual game

game.name (String)

Unique name for the virtual game

game.type (String)

The type of virtual game

playType (String)

The type of play

playValue.value (Number)

The amount placed on the play, rounded to 2 decimal places

playValue.currency (String)

The ISO 4217 currency code, (for example, GBP, USD)

platform (String)

The platform the game runs on (for example, Flash)

virtualCurrencyUsed (Boolean)

True if the game is being played with a virtual currency rather than deposited funds

gamePlayId (String)

Unique gameplay event Id, equivalent to a transaction Id and for each played instance of the virtual game

playMode (String)

The type of funds used to play the game (for example, virtual, digital, free play, bonus)

Example JavaScript

uv.emit('egGamePlay',{
  game: {
    gameId: '1234',
    name: 'Rainbow Riches',
    type: 'slots'
  },
  playType: 'spin',
  playValue: {
    value: 9.99,
    currency: 'USD'
  },
  platform: 'Flash',
  virtualCurrencyUsed: true,
  gamePlayId: '3434343',
  playMode: 'digital'
})

Setup guidelines

playValue