Background
Global-e offers a checkout solution for e-commerce retailers looking to expand internationally, partnered with Klarna to enable pay later, slice it, or pay now across the e-stores (“merchants”) where their checkout is displayed. Global-e owns all claims and liabilities on behalf of their merchants, so Klarna has signed them as a Merchant of Record and not as a partner. Each of the three Klarna regions (EU, US, and OC) has a single MID and credentials managed by Global-e. These credentials have been implemented in Global-e Checkout and are used across all Global-e merchants. As Global-e only offers the checkout solution, merchants use their platform to manage other pages in the e-stores, this means that Global-e has no direct control over the implementation of Klarna On-Site Messaging (OSM) for the merchants. The purpose of this section is to provide support for Global-e when working with merchants implementing Klarna OSM in their e-stores. The following guidelines describe the key considerations and best practices for implementation, especially when implementing OSM in multiple markets. For more information about Klarna’s services, see Klarna.Best Practices
To maximize the performance of the OSM integration merchants should perform the following:- Include the JavaScript Library in the code as early as possible. Add it before any content in the html, right after opening the body tag.
- Load the JavaScript Library “asynchronously”. Make sure that the script has the async attribute set.
- Avoid using a tag manager.
- If the merchants’ solution relies on templates, make changes in a central file to ensure placements added to other pages will render.
-
If it is a Shopify merchant, other apps may influence the performance of On-Site Messaging. Review installed apps to verify they are all still necessary and review all the resources loaded for the page, such as using the browser’s developer tools.
Klarna Shopify OSM app is not supported with Global-e for On-site messaging Shopify merchants should integrate directly.
Global-e Considerations
There are several considerations for merchants integrating via Global-e, including but not limited to:- If the merchant is integrated locally through another partner, make sure to continue using this script for installation in the appropriate local market, and use the Global-e scripts above, for other locations.
- The merchant has to handle the site language, by setting the country, currency and locale from the Global-e cookie - GlobalE_Data.
- Global-e provides price conversions. it is possible to set the converted price in the DOM instead of the native price and set the attributes of its parent element:
ge-data-converted-priceandge-data-converted-full-price. If the price has to be converted beforehand, then there is also an option to use Global-e JS external method to retrieve the converted price on client side. If support is required on this issue, merchants should discuss this with Global-e.
The Workflow
| Homepage Inform shoppers about Klarna as early as possible. Use the top-strip promotion and banners to inform customers about available payment methods. | Klarna_OSM_Integration_-_Homepage.png |
|---|
| Product page Show customers that they can shop now and pay later with Klarna. Use the payment messaging and let the shoppers calculate their budget before purchasing. | Klarna_OSM_Integration_-_Product_Page.png |
|---|
| Cart & Checkout Give the customers the purchase power to finalize the purchase. Inform customer of their purchase power with messaging tailored to the final order amount. | Klarna_OSM_Integration_-_Cart_and_Checkout.png |
|---|
Klarna JavaScript Library
The On-Site Messaging (OSM) will only work by adding the JavaScript Library code snippet to all website pages along with the placements in specific places where you want messaging to appear. Although the exact way merchants edit their e-store may differ depending on the e-commerce solution, the steps described below apply for all websites.- Merchants will need access and editing privileges to the source code of your e-store. This is a good point in time to involve a developer in the process.
- Merchants will also need to know where on the e-store they would like the messaging to appear.
- Communicating with the On-Site Messaging to deliver messaging for placements.
- Optimizing the user experience by leveraging a cache layer.
- Setting cookies in order to assure consistency in delivered messaging.
- Handling interstitial operations to allow user interaction without affecting the website.
| Attribute | Description |
|---|---|
| src | Klarna OSM script URL |
| async | Makes loading the script non-blocking |
| data-client-id | OSM identifier for merchant configuration |
- EU - Europe
- NA - North America
- OC - Oceania
Supported Countries
The countries currently supported in each region are listed in the below table:| Region | Country | Country Code | Locales |
|---|---|---|---|
| EU | United Kingdom | GB | en-GB |
| EU | Ireland | IE | en-IE |
| EU | Sweden | SE | sv-SE; en-SV |
| EU | Finland | FI | fi-FI; en-FI |
| EU | Norway | NO | no-NO; en-NO |
| EU | Denmark | DK | da-DK; en-DK |
| EU | Austria | AT | de-AT; fr-AT; it-AT; en-AT |
| EU | Germany | DE | de-DE; en-DE |
| EU | Netherlands | NL | nl-NL; de-NL; en-NL |
| EU | Belgium | BE | fr-BE; nl-BE; en-BE |
| EU | Italy | IT | it-IT; en-IT |
| EU | Spain | ES | es-ES; en-ES |
| EU | France | FR | fr-FR; en-FR |
| NA | United States | US | en-US |
| NA | Canada | CA | en-CA; fr-CA |
| OC | Australia | AU | en-AU |
-
EU (single MID)
-
US (single MID)
-
CA (single MID)
-
OC (single MID)
If the merchant is integrated locally through another partner, they will need to make sure to continue to use this script for installation in the appropriate local market, and use the Global-e scripts above for other locales.
Placements
Placement tags are the HTML tags that decide where to display messaging to visitors on your website. Placements require basic configurations to adjust them for your needs. Some attributes are required and others are optional.| Attribute | Mandatory or Optional | Description |
|---|---|---|
| data-key | Mandatory | Identifier for the placemen, uniquely identifies a placement type and size. |
| data-locale | Optional | Locale of the ad. If not defined, use default locale for country. |
| data-purchase-amount | Optional | The amount of money in micro units ($120.00 = 12000), used for amount-based credit promotions. |
| data-inline=”true” | Optional | The attribute will render placements inline in cases where content has been configured for this. |
| data-preloaded=”true” | Optional | Set when a placement is preloaded. Read more about in Pre-loading placements |
| data-theme=”default” | Optional | Set a theme to override the default or customized content. |
if the data locale of the placement is not configured for the data-client-id, the placement will not be displayed.
data-key="credit-promotion-badge"data-key="credit-promotion-auto-size"data-key="credit-promotion-small"
- Some data keys may not be available for all Klarna locales/markets.
- We do not provide the currency in data-purchase-amount value, currency is based on the sub-merchant configuration for the country and data-client-id.
- If the placement includes a data-purchase amount the placement will either advise the consumer of the cost when splitting into installments or the minimum amount to spend to use the credit-based product.
- Load new content without page refresh (i.e. Ajax) and this new content contains a placement tag.
- Change the purchase amount for placements dynamically without page refresh.
- Infinity scroll on the page with dynamically loaded content on scroll.
- Configure the placement properly.
- Make sure to fire the impression once a visitor sees the messaging.
Common Issues
Outlined below are some of the common issues seen when implementing OSM:- OSM requires cookies, if staging does not allow this the placements won’t load.
- Production OSM doesn’t show until there has been a purchase on the credentials.
- Password-protected Staging sites can block the OSM’s ability to load.
- Global modifiers on iframes/restricting the iframe can result in it failing (no OSM showing).
- Playground and production will usually have different data-client-id, so this should be considered when testing and using OSM in Production.
- Amounts must be presented in minor units (i.e. $56 should be 5600), and decimals should not be sent.
- The placement will display the amount fed into it, so if you are displaying both sales and full price ensure you are feeding the correct value into the placement.
- If payment methods shown do not match those available, ensure you are using the production and not playground placement.
-
Some placements are only available in certain markets or with certain payment methods - so ensure you are pulling from the correct Merchant Portal and trying to just change the data-client-id to get it to work.
- Example - credit-promotion-auto-size is not available in the US, and top-strip-banner is not available without pay later).
-
It is best to not use css to hide placements on the page (visibility: hidden) this can lead to the placement loading then disappearing, resulting in the placement appearing to ‘flash’ on the page. Credit-based placements which include amounts will dynamically adapt to the amount used when loading the placement.
- Example - a credit placement implemented on a PDP with the data-purchase-amount =2500 for a en-GB consumer will display wording “Make 3 easy payments. Available for orders above £35. Klarna. Learn more”.

