Skip to main content
Version: 1.0.0

Session_Gateway

Purpose​

The Session_Gateway collection defines the structure of user sessions inside a gateway.
Its purpose is to track analytics data, including device information, geolocation, catalogue references, page visits, and user interactions during the session.

Document schema​

{
"catalogue_refs_list": ["string"],
"device": "string",
"device_id": "string",
"device_os": "string",
"events_analytics_list": [
{
"acceptance_pp_terms": "boolean",
"animation_3d_start": "number",
"brand_page_scroll_perc": "number",
"click_dice_button": "number",
"click_start": "boolean",
"find_store_click": "number",
"interaction_width_3D": "boolean",
"share_click": "number",
"shop_button_click": "number",
"snapshot_click": "number"
}
],
"gateway_name": "string",
"geoLocation": "string",
"is_first_session": "boolean",
"isgeolocationAccept": "boolean",
"latitude": "number",
"longitude": "number",
"page_analitycs_list": [
{
"page_name": "string",
"visualizazion_time": "number"
}
],
"session_end_date": "string",
"session_start_date": "string"
}

Indexes​

  • catalogue_refs_list is a [] of strings that refer to the IDs of the Catalogues collection

Query examples​

// Fetch the Reference Doc from Firebase
const sessionGatewayRefDoc = doc(db, "Session_Gateway", sessionId);

// Get the Document Snapshot from the Reference Doc
const sessionGatewayRefSnap = await getDoc(sessionGatewayRefDoc);

// Query sessions for a specific gateway
const sessionsByGateway = query(
collection(db, "Session_Gateway"),
where("gateway_name", "==", "Tommy Experience ROADTOUR")
);

// Query sessions for a specific catalogue
const sessionsByCatalogue = query(
collection(db, "Session_Gateway"),
where("catalogue_refs_list", "array-contains", catalogueId)
);