import { bool, DateTime, Option, u16, u32, Utc, Uuid, Vec } from "./_commons"; import { VideoRecorder } from "./VideoRecorder"; /** * PageInformation contains the metadata about a PageVisit. It is sent once * from Collect to Metroplex at the start of a new page visit. */ export interface PageInformation { /** * BrowserID is a unique id for all browsers * Generated by Collect if it is able to. If Collect cannot then it will omit this field. * Renamed to browser_id in metroplex */ br_id: Uuid; /** * SessionID is a unique id for a session. Generated by collect.js. * Here is how it works: * 1. Session starts, session_id uuid is generated * 2. User does some actions, changes pages, new PVs sent still have the same session_id uuid * 3. User leaves the page, comes back in 30+ mins and does some action -> new session_id uuid is regenerated, all next pvs have this new session uuid */ session_id?: Option; /** * Session token received from Metroplex and echoed back. * Metroplex uses this for session continuity when Redis is unavailable. * NoibuJS stores and returns this value verbatim. */ session_token?: string; /** * PageVisitID is the id of the session this video belongs to * Generated by Collect at the start of each page visit * Renamed to id in metroplex */ pv_id: Uuid; /** * Version is the version of the payload. Set to 5 for now * Sent by Collect * Renamed to pagevisit_version in metroplex */ v: u16; /** * version of the client script talking to Metroplex. This will be the git commit sha. * we allow defaults as this field was added after noibujs was * deployed to all customers, and we do not want to drop information from cached scripts.// */ script_id: string; /** * instance of the client script talking to Metroplex. * we allow defaults as this field was added after noibujs was * deployed to all customers and we do not want to drop information from cached scripts.// * Renamed to script_instance_id in metroplex */ script_inst_id?: string; /** * instance of the metroplex socket id talking to Metroplex. * we allow defaults as this field was added after noibujs was * deployed to all customers and we do not want to drop information from cached scripts.// * Renamed to metroplex_socket_instance_id in metroplex */ mp_sock_inst_id?: string; /** * instance of the socket. * we allow defaults as this field was added after noibujs was * deployed to all customers and we do not want to drop information from cached scripts.// * Renamed to socket_instance_id in metroplex */ sock_inst_id?: string; /** * Seq is the sequence number of this page visit in the list of page visits * inside a websession. Collect stores this value in localstorage and start it * at 0. Every page a user visits that gets a new page visit ID will get the next * integer in seq. */ seq: u32; /** * IsLast indicates wether this PageVisit is the the last time for this pv.ID * Multiple page visits are sent for the same pv.ID because it may need to be * broken up into multiple sends to get past the 64kB send. This field is not * kept by jolt * Renamed to is_last in metroplex */ last: bool; /** * ConnectionCount is the number of past connections that were done for the * same page visit. This number is increased every time we reconnect to the socket. * Renamed to connection_count in metroplex */ conc: u16; /** * OnURL is the url visible to the user (window.location) * Maximum length accepted is 1024 */ on_url: string; /** * ReferringURL is the URL that we came from * Sent by Collect and grabbed via a browser set property * that's why we do not validate. * Maximum length accepted is 1024 * Renamed to referring_url in metroplex */ ref_url: string; /** * StartedAt is the time that the web page visit started. This is browser time. * Sent and generated by collect * Renamed to started_at in metroplex */ start_at: DateTime; /** * Version of the client script deployed on our customers websites * Renamed to client_script_version in metroplex */ cv: u16; /** * Language of the user's browser * we allow defaults as this field was added after noibujs was * deployed to all customers, and we do not want to drop information from cached scripts. * Renamed to language in metroplex */ lang?: string; page_title?: Option; page_groups?: Option>; ref_page_groups?: Option>; video_recorder?: VideoRecorder; }