jppol-audio-platform-web-sdk
v1.2.0
Published
Install package:
Readme
JPPOL Audio Platform (Web Analytics SDK)
Install
Install package:
npm install jppol-audio-platform-web-sdkImport and initiate
Import the createAnalytics from.
import { createAnalytics } from 'jppol-audio-platform-web-sdk'Create global analytics instance.
const analytics = createAnalytics({
// Config
})Create sessions with relevant meta data.
analytics.createSession(<HTMLAudioElement>, {
// Session
})Create embed session with relevant meta data. Basic details are fetched via the API.
analytics.createEmbedSession(<HTMLIFrameElement>, {
// Session without 'program_id', 'clip_id' & 'clip_name'.
})Types
type Config = {
env: 'test' | 'production'
org: string // The organisation.
brand: string // The brand.
client: string // ID of the app or web-site (source in Omny).
client_version: string // The version of the app or web-site.
apiKey: string // Key used to sign the request.
// OPTIONALS
user_agent?: string | null // For web sites, the user agent of the browser. (nullable)
os?: string | null // The operating system of the device. (nullable)
os_version?: string | null // The operating system version. (nullable)
device_model?: string | null // For apps, the device model. (nullable)
}
type Session = {
program_id: string // The Omny ID of the program (aka podcast).
clip_id: string // The Omny ID of the clip (aka podcast episode).
clip_name: string // For convenience when exploring data.
was_restricted: boolean // Whether the episode had restricted access in Omny Studio at the time of playback (true = restricted, false = public access).
// OPTIONALS
article_id?: string | null // The CUE ID where the episode was played. (nullable)
referrer?: string | null // The referrer typical if there is no article_id, can be url or name of referrer. (nullable)
referrer_id?: string | null // If there is an id for an external system connected to the referral, it can be stored in this field. (nullable)
sso_id?: string | null // The MedieLogin ID of the user. (nullable)
anon_id?: string | null // An anonymous ID of users not logged in. (nullable)
auth_reason?: string | null // How the user had access to the product. (nullable)
}