Send analytics to Google Analytics
To send events from the BeyondWords player to a configured Google Analytics account:- Go to Analytics → Preferences in your project dashboard
- Enable Send data to Google Analytics
- Enter your Google Analytics Measurement ID or Google Tag Manager Container ID in the Identifier field
- Click Save changes
Send analytics to a custom endpoint
To send events from the BeyondWords player to a custom endpoint:- Go to Analytics → Preferences in your BeyondWords dashboard
- Enter the custom analytics URL to send player events to
- Click Save changes
POST requests using the event schema below.
Send analytics to BeyondWords
To send analytics from a custom player to BeyondWords, send aPOST request to https://metrics.beyondwords.io using the event schema below. We recommend sending as many fields as possible so events can be aggregated accurately, although sensible defaults will be applied for some missing fields.
Some fields may not apply to your implementation. These can be omitted and will be ignored.
When testing custom events, it may take up to an hour for data to appear in the BeyondWords dashboard. If you need help, contact support.
Example event
The following example shows a typical analytics event payload. To inspect analytics events, search formetrics.beyondwords.io in your browser’s Network tab.
Example event
Event schema
The type of analytics event. There are four types:
- load: content loaded successfully and the media’s duration is known
- play: the media started playing for the current content item
- play_progress: playback reached the next 10% of the audio’s duration
- ad_link_click: the user clicked on the click-through URL for an advert
The type of device that emitted the event. There are three types:
- phone: the width of the browser was between 0px and 499px
- tablet: the width of the browser was between 500px and 999px
- desktop: the width of the browser was 1000px or greater
- ios: the event was sent from a native ios app (e.g. )
- android: the event was sent from a native android app (e.g. )
The type of media loaded in the player. There are two types:
- content: the event was emitted during content playback
- ad: the event was emitted during advert playback
The variant of media loaded in the player. There are two types:
- article: the media is for the original article
- summary: the media is for a summary of the article
The numeric ID of the project whose content is loaded into the player. This field might be null if content wasn’t fetched from the API and is instead set manually in the player.
The string UUID or numeric ID of the content currently loaded into the player. This field might be null if content wasn’t fetched from the API and is instead set manually in the player.
The string ID that can optionally be associated with the content currently loaded into the player. This field might be null if the source_id ID wasn’t set in the BeyondWords API.
A numeric ID used by BeyondWords for associating this event with your project. This field might be null if content wasn’t fetched from the API and is instead set manually in the player.
The numeric ID of the advert that is currently loaded into the player. This field is null when an advert isn’t playing, i.e. when content is playing.
The numeric ID of the content or advert media field that is currently loaded into the player. This field is null when VAST adverts are playing.
The format of media loaded in the player. There are two formats:
- audio: the player is playing audio (or will play audio)
- video: the player is playing video (or will play video)
A string UUID associated with the current user and stored in local storage under the ‘beyondwords’ key. This field is null if advertConsent is set to ‘without-local-storage’.
A string UUID associated with the current player instance. This ID changes after the page is reloaded and is different for each player instance.
The unix time in milliseconds at which the first analytics event was sent from the current player instance, as reported by the user’s browser.
The duration in seconds of the content or advert media currently loaded into the player.
The duration in seconds that the user has listened to of the currently loaded media.
The percentage that the user has listened to of the currently loaded media.
The speed at which the user is listening to the media, e.g. 0.5, 1 or 2.
Whether playback from segments is enabled, i.e. whether the clickableSections player setting is anything other than “none”.
The value of window.location.href when the event was emitted.
The value of document.referrer when the event was emitted.
This will always be the string “1” but we may use this later, e.g. to run A/B tests.
The version of the NPM package as specified in the package.json file.