On-site messaging placements are containers that hold Klarna messaging assets and are placed on recommended pages of the store based on type. There are two types: (1) site-wide placements, that are shown across multiple pages to ensure consistent visibility, and (2) product and cart placements, shown in context-specific areas like product or cart pages to reinforce messaging at key decision points.
Top Strip: A persistent banner that reminds customers Klarna is available, with a brief message explaining flexible payment options. This builds early awareness from the first touchpoint.
Footer: Klarna's logo is shown alongside other accepted payment methods, reinforcing trust and availability without disrupting the user experience.
FAQ Page: A dedicated, localized landing page that explains how Klarna works, answers common questions, and supports decision-making with transparent information.
Top strip site-wide
Footer site-wide
FAQ page
Each placement has an unique key that should be used in order to specify the placement to be displayed. A small HTML snippet should be created to pass the necessary attributes.
Placement types
Options
top-strip-promotion-auto-size
Recommended as static asset at the top of the pages of the online store. Displays interactive Klarna messaging. Customers can click on it and expand the information on the payment methods. Mentions Klarna inline as part of the text.
top-strip-promotion-badge
Recommended as static at the top of the pages of the online store. Displays interactive Klarna messaging. Customers can click on it and expand the information on the payment methods.
footer-promotion-auto-size
Recommended static asset at the bottom of every page of the online store showcasing the payment methods offered via Klarna.
info-page-auto-size
Displays a FAQ to clarify common questions about buying with Klarna. The FAQ is dynamic based on the configuration and offered payment methods.
Personalized messages tailored to the total value in cart or product page, highlighting Klarna's best available payment options to drive confidence and conversion at key decision points. |}
Product detail page with On-site Messaging
Cart page with On-site Messaging
Each placement has an unique key that should be used in order to specify the placement to be displayed. A small HTML snippet should be created to pass the necessary attributes.
Placement types
Characteristics
credit-promotion-auto-size
Displays interactive Klarna messaging. Customers can click on it and expand the information on the payment methods with calculated prices. Mentions Klarna inline as part of the text.
credit-promotion-badge
Displays interactive Klarna messaging. Customers can click on it and expand the information on the payment methods with calculated prices. Displays Klarna's logo in svg,
On-site Messaging placements allow Partners to display Klarna payment options and promotions at key points in the customer journey (for example, product, cart, or site wide). This increases customer awareness of flexible payment options and can boost conversion rates.
On-site messaging renders its content within a shadow DOM to prevent the styles from being accidentally applied to the pages that host the placements. This ensures that the styles on the host pages do not interfere with the content of the on-site messaging
Styling of informational modal that appears after a customer clicks a click-to-action button is not supported. As this area is dedicated to informing customers about the financial services provided by Klarna.
Klarna does not offer support for custom styling the informational modal that appears after a customer clicks a click-to-action button. As this area is dedicated to informing customers about the financial services provided by Klarna, Klarna's own branding must be maintained.
To add the CSS styling, access to the source code of the website is required.
Klarna recommends adding an id to the klarna-placement element to make it easier to target the elements for styling. This allows customization of the appearance of the placements without affecting the rest of the page.
Partners are responsible for ensuring that styling the on-site messaging with CSS does not compromise the accessibility of the website. For example, the contrast between the message and the background must be sufficient for people with low vision to read the message. Chrome DevTools can help detect any accessibility issues.
To enable styling of the placements with CSS from outside the shadow DOM, Klarna uses the ::part API to expose certain elements of the placements that can be styled. Only elements of the placement that have the part attribute can be targeted with CSS for styling purposes. This allows customization of the appearance of the placements without interfering with the content within the shadow DOM.
The list of exposed ::part pseudo-elements is shown below:
Pseudo-element
Description
Placement types
::part(osm-container)
The wrapping element of the placements is the container that surrounds the placement. It can be styled with the ::part(osm-container) selector.
credit-promotion-auto-size
credit-promotion-badge
top-strip-promotion-auto-size
top-strip-promotion-badge
info-page
footer
::part(osm-message)
The main text of a placement is the primary message that is displayed within the placement. It can be styled with the ::part(osm-message) selector.
credit-promotion-auto-size
credit-promotion-badge
top-strip-promotion-auto-size
top-strip-promotion-badge
::part(osm-legal)
The legal text that appears under the main message in some markets is an important piece of information that must be clearly visible and readable to the customers. It can be styled with the ::part(osm-legal) selector. This text must not be hidden or obscured in any way, as it is required for compliance reasons.
credit-promotion-auto-size
credit-promotion-badge
top-strip-promotion-auto-size
top-strip-promotion-badge
::part(osm-cta)
The button element that triggers the opening of the informational model is the element that the customer clicks on to view additional information about the product or service being offered. It can be styled with the ::part(osm-cta) selector.
credit-promotion-auto-size
credit-promotion-badge
top-strip-promotion-auto-size
top-strip-promotion-badge
::part(osm-link)
Link elements with the <a> tag are the elements on the page that use the <a> tag to create a hyperlink to another location on the web. They can be styled with the ::part(osm-link) selector.
info-page
Do not use CSS to hide Klarna's logo or badge in the placements. Klarna reserves the right to turn off the integration if it abuses this rule, as hiding Klarna brand elements goes against maintaining branding integrity and visibility.
The theme defines the placement's color. It can be changed by setting the theme attribute of the chosen placement.
The placement's default theme color is white (light). As the theme attribute is optional, the default theme is applied both when the attribute is set to default or omitted from the source code altogether.
The Partner's site font may be used to maintain brand consistency. However, Klarna recommends using a system font or a clean, legible typeface to ensure readability and better alignment with Klarna's brand.
When using a custom font, please avoid italics or any stylistic variations that hinder legibility. While Klarna understands the importance of maintaining visual consistency with the Partner's brand, readability must take priority to ensure alignment with Klarna's messaging standards.
The following examples show how CSS can be used to style On-site messaging placements. The modified elements are: the font-family of the text to use an externally loaded font, for example, a Google font, and the size of the badge.
When multiple placements of the same type are present on a single page, such as multiple credit-promotion-auto-size placements on a product listing page, classes can be used instead of IDs to target all of the placements at once. For example:
When the same placement type is used in different areas of the website, for example, on the checkout page and on the product page, but styled differently in each, use a different id or class for each klarna-placement element to target the element and apply the desired styles to each.