Skip to content
Documentation

Sell more

Buttons on your own page

Your gift card page can stand on its own, but most sales happen where the customer already is. One line of code places a button on your page — and you decide where it stands, what happens when it is clicked, and how it looks.

The short version

Insert this line just before </body> on your page. Then you're ready: a «Buy gift card» button appears in the corner, and it opens your shop in a window on top of the page.

HTML
<script src="https://shop.kuvert.dk/embed.js" data-slug="dit-butiksnavn"></script>

Four ways to do it

MethodWhat you writeWhen
Floating buttonOnly the <script> lineFastest. Sticks in the corner on all pages.
Button where you want<span data-kuvert-buy></span>Place it next to a product, in the menu, in the footer. As many as you want.
Your own buttondata-kuvert-open on your own elementYou already have a button or a link that fits your page.
Whole shop<div data-kuvert-inline></div>The gift card page is displayed directly on your page — no button, no window.

The floating button disappears by itself as soon as you insert one of your own. You never end up with two buttons by accident.

HTML
<!-- One button per product, each with its own amount -->
<span data-kuvert-buy data-amount="300" data-label="Gavekort · 300 kr."></span>
<span data-kuvert-buy data-amount="500" data-label="Gavekort · 500 kr."></span>

<!-- Your own link in the menu -->
<a href="/gavekort" data-kuvert-open>Gavekort</a>

<!-- Once, at the foot of the page -->
<script src="https://shop.kuvert.dk/embed.js" data-slug="dit-butiksnavn"></script>

Here's what it will look like

Try it out below. These are the real buttons — same size and shapes as your customers see.

Size
Corners
  • Filled

    Standard. Your colour, white text.

    data-variant="solid"
  • Border

    For light pages and secondary placements.

    data-variant="outline"
  • Text only

    For a menu or footer.

    data-variant="text"

What you select here matches the attributes below. In the dashboard there's the same setup with a button that copies the code — you don't need to type it yourself.

If you already have a design you'd rather use, set data-class to your own classes. Then we keep our hands off the look entirely, and the button inherits your own styling instead of clashing with ours.

HTML
<span data-kuvert-buy data-class="btn btn-primary"></span>

Choose what the button opens

A button can point to a specific product, a fixed amount, a quantity — and start the buyer further into the flow. That's how «Buy gift card · 500 kr.» becomes one click instead of four.

HTML
<span data-kuvert-buy
      data-product="prod_spaophold"
      data-amount="500"
      data-quantity="2"
      data-label="To spa-gavekort · 500 kr."></span>

A button for your next event

data-event normally points to one specific event. If you write next instead, the button opens the next one that's for sale — and you don't have to edit your page every time you set a new date.

HTML
<a href="/arrangementer" data-kuvert-open data-event="next">Billetter</a>

All options

AttributeWhereExample
data-slug<script>anyone
data-origin<script>https://shop.kuvert.dk
data-localebothda
data-button<script>auto
data-kuvert-buyon the element
data-kuvert-openon the element
data-kuvert-inlineon the element
data-labelbothBuy gift card
data-colorboth#b8935a
data-text-colorboth#ffffff
data-sizebothmd
data-shapebothpill
data-variantbothsolid
data-blockbothtrue
data-classbothmin-knap
data-position<script>br
data-productbothprod_open
data-amountboth500
data-quantityboth1
data-stepbothpersonalize
data-eventbothnext
data-campaignbothcmp_jul
data-heightboth640
data-modebothmodal
data-consent<script>granted
data-schemebothdark
data-bookingbothtrue

For developers

The script places window.kuvert on the page, so a single-page app can open the shop from its own code, and sends events on window, which your own analytics tool can listen to.

JavaScript
kuvert.open({ product: 'prod_spaophold', amount: 500 })
kuvert.close()

window.addEventListener('kuvert:checkout', (e) => {
  // e.detail — pass it on to your own analytics
})
  • kuvert:ready — the script is loaded and the buttons are set up
  • kuvert:open — the shop was opened
  • kuvert:close — the shop was closed again
  • kuvert:checkout — the buyer clicked pay, with amount and quantity

Render your page's buttons after the script has run — as a React or Vue page would — then call kuvert.refresh(). It collects new buttons and skips the ones it already knows.

Consent when the shop is on your page

If you've placed a Google Tag Manager container on your gift card page, it runs only when the customer has consented. If the customer opens the shop directly on shop.kuvert.dk, Kuvert asks itself — once, and the answer is remembered. But if the shop is embedded on your own page, YOUR cookie banner has already asked, so Kuvert shouldn't ask again in the middle of a modal just before the customer pays. You pass the answer on:

HTML
<!-- server-side banner: set the attribute -->
<script src="https://shop.kuvert.dk/embed.js" data-slug="dit-butiksnavn"
        data-consent="granted"></script>
JavaScript
// JavaScript banner: tell us when the customer answers
kuvert.consent(true) // or false, if they decline