Docs
Integrations & DevelopersJavaScript API
Open dashboard
Integrations & Developers

JavaScript API

Send Morev the moments a page cannot show on its own: a custom checkout, a quiz in your own app, a webinar you host.

Using it

A safe way to call it
// The snippet loads after your page, so check it is there
window.morev && window.morev.track("pricing_toggled", { plan: "annual" });

// A sale from your own checkout
window.morev && window.morev.purchase(499, "usd");

Methods

MethodWhat it records
track(name, details)Your own event, with any details you like.
identify(userId, traits)Ties this visit to your own user ID.
optIn(email, name)Someone joined your list.
formSubmit(formId, fields)A form was sent.
conversion(value, currency)A conversion, with an optional value.
callBooked(source, details)A call was booked, for a scheduler Morev cannot detect.
checkout(stage, details)Checkout progress. The stage is start, cart or payment.
addToCart(details)Something was added to a cart.
purchase(value, currency, details)A sale. This is what makes the visitor a buyer and records the money.
paymentFailed(reason, details)A payment did not go through.
quizStart() · quizAnswer(question, answer) · quizComplete()Quiz progress.
webinarRegister() · webinarAttend() · webinarOffer()Webinar sign-up, attendance, and the offer being shown.
cta(name)A main button was clicked.
experiment(testId, versions)Gives this visitor a version and records the view. See A/B testing.
experimentConversion(testId)Records the win for a test.
video(id, state, percent)A video Morev cannot detect on its own, like a custom or locked player. The state is play, progress, pause or complete.
consent(status)Tells Morev the visitor's choice: granted, denied, partial or unknown.
getVisitorId() · getSessionId()The IDs of this visitor and visit.
checkoutRef()The reference to give your checkout (Stripe client_reference_id), so its payment is tied to this visit.
decorate(url)Adds the visitor tag to a link to another domain.
flush()Sends anything waiting right now.

Attributes you can add to your page

AttributeWhat it does
data-siteOn the snippet. Your site key. Required.
data-morev-track="name"A click on this element records an event with that name.
data-morev-ctaMarks an element as a main button.
data-section="name"Marks a section whose time in view is recorded.
data-quizMarks a block as a quiz, so its answers are recorded.
data-morev-blockHides this part of the page from session replays.
data-consentOn the snippet. The consent state to start with.
Other domains
When someone clicks a link to another domain, Morev adds a small tag to it (mv_vid and mv_sid) so the visit carries across. The tracker on the other domain reads it.
Was this page helpful?
Morev documentationNeed help? support@morev.io