ecomone developers
Open Ecomone
Docs / Landing pages

External landing pages

Script for merchant-owned external landing pages: links buy buttons to the Ecomone checkout and carries attribution (UTM/click ids) and consent into the shop.

Embed the script#

Before </head>
<script async src="https://app.ecomone.shop/ext/v1.js" data-shop="<shop-slug>"></script>
AttributeDescription
data-shopShop slug; must match ^[a-z0-9-]{1,100}$ or the script does nothing.
data-consent"granted" or "denied" - initial marketing consent. Without it, consent is assumed only if the page is served via Cloudflare and /cdn-cgi/trace reports the visitor in Switzerland (loc=CH); otherwise denied until window.ecomone('consent', ...).

Buy buttons#

Mark any link or button. On click the visitor goes straight to the Ecomone checkout, with attribution and session carried over.

HTML
<a href="#" data-ecomone-offer="your-offer-slug">Buy now</a>
<button data-ecomone-product="product-handle">Add to cart</button>
<a href="#" data-ecomone-cart>Go to checkout</a>
AttributeOpens
data-ecomone-offer="<offer slug>"https://<checkoutHost>/directcart/<slug>
data-ecomone-product="<product handle>"https://<checkoutHost>/products/<handle>
data-ecomone-carthttps://<checkoutHost>/warenkorb

Consent is collected once, on your landing page. The script passes the decision to the checkout, which then shows no second banner. Without consent only strictly necessary data is processed; browsers sending Global Privacy Control are never tracked. If your page is served through Cloudflare, visitors from Switzerland are handled under the Swiss opt-out rules automatically; otherwise call ecomone('consent', …) or set data-consent.

Node.js
// after your cookie banner decision
window.ecomone('consent', { marketing: true });  // or false

JavaScript API#

If window.ecomone exists before the script loads and has a q array (e.g. window.ecomone = window.ecomone || function(){(window.ecomone.q = window.ecomone.q || []).push(arguments)}), queued calls are replayed. Return values of queued calls are lost.

CallReturnsEffect
ecomone('consent', { marketing: true | false })—true: store attribution (localStorage, 30 days), load the shop's Meta/Google/TikTok pixels (unless tracking tier is basic) and start the analytics session. false: purge stored data and revoke pixel consent. Global Privacy Control (navigator.globalPrivacyControl) always forces denial.
ecomone('checkoutUrl', { offer?: string, product?: string } (neither = cart))string - decorated checkout URLBuilds the same URL a click would use. Before the config has loaded it uses <slug>.ecomone.shop as host.

What is tracked#

With consent, the script records the visit as a storefront session of the shop (live view, visitors, funnel), keeps UTM and click ids, fires the shop's Meta pixel and continues the same session into the checkout. The merchant sees each connected page with visits, orders and revenue under Marketing › External landing pages.

Authorize requests

Requests go straight from your browser to https://api.ecomone.shop. Your credentials stay in this browser tab and are never sent to this documentation site.