Store Analytics
Every LaunchMyStore storefront records its own traffic: visitors, sessions, traffic sources, pages, products viewed, add-to-cart, checkout and purchases. Merchants see it under Analytics → Traffic in the admin. Themes don’t need to add anything for this to work.How it is loaded
content_for_header includes one small, asynchronous script:
- It is served from the store’s own domain and posts events back to the
same domain at
/.well-known/lms/events, so it works on custom domains and is not a third-party request. - It never blocks rendering. The file is versioned (
?v=) and cached for a year. data-ptis the page type (product,collection,search,cart,checkout).data-pid,data-pnanddata-phcarry the product id, the product title, and the collection handle or search terms for that page. The tag holds no store id and no visitor data, so it is safe in cached pages.
Keep
{{ content_for_header }} in your layout’s <head>. Without it the
store’s analytics (and app embeds, pixels and other platform scripts) stop
working.What it records automatically
The source of a visit is taken from the referrer and from
utm_source,
utm_medium, utm_campaign, utm_content, utm_term, ref, and Google / Meta
click ids. It’s kept for the whole session and credited to the order, so a
sale from an Instagram ad shows up under Instagram / Paid.
Add-to-cart detection reads the browser’s resource timing: the request counts
once its response body has been read. All standard theme cart code already
reads it. If you write custom cart code, read the response
(await res.json()), as you would to update the cart drawer anyway.
Goals
Count a click as a goal by addingdata-lms-goal to any element:
Privacy and consent
- The visitor id lives in first-party storage (
localStorage). No cookie is set for analytics, and nothing is shared with third parties. - URLs are recorded without their query string, so emails, tokens or codes in a URL never leave the browser.
- No IP address is stored. The country, region and city come from the network edge at the time of the visit.
- The tracker checks
window.LMS.customerPrivacy.analyticsProcessingAllowed()before recording. If your theme or a consent app sets it to returnfalse, nothing is sent. - Bots, headless browsers and automated test browsers are not counted.