Skip to content

Instantly share code, notes, and snippets.

import io.moonsense.sdk.Moonsense
import io.moonsense.sdk.model.Session
Moonsense.initialize(
context,
"ADD PUBLIC TOKEN HERE .."
)
var session: Session? = Moonsense.startSession(
15,
import MoonsenseSDK
Moonsense.initialize(
publicToken: "ADD PUBLIC TOKEN HERE .."
)
var session: Session? = try? Moonsense.startSession(
duration: 15,
labels: ["label1", "label2"]
)
import { Moonsense } from '@moonsense/moonsense-web-sdk';
const moonsenseSdk = new Moonsense({
publicToken: 'ADD PUBLIC TOKEN HERE ..'
});
const session = moonsenseSdk.startSesssion(15000);
session.stopSession();
session.addCustomEvent(
"page_view",
"/65242628309/orders/0741e175be4d5ddb25291b4a189aa1e9",
{
"referer" : "",
"fragment": "..."
... other page metadata as needed
}
)