Affirm promotional messaging helps you showcase financing options to your customers, improvise conversion rate and average order value. This guide provides our integration options to get you started.

## e-commerce platforms

If your site runs on an e-commerce platform, implementing Affirm promotional messaging is simple. Head over to our [Platforms documentation](🔗) for more information.

## Affirm.js

Affirm.js is a Javascript library that you add to your website to enable the rendering of promotional content and ensures a seamless communication between the HTML tags you add to your site, like the `data-page-type` and Affirm’s servers. Follow the the integration steps below to use Affirm.js.




## Integration steps

  1. Add Affirm.JS

  2. Insert promotional messaging HTML Tags

## Step 1: Add Affirm.JS

In order to use Affirm promotional messaging, you’ll first need to include the Affirm.js library in the head of your site’s global page template. This ensures that the library is loaded on all pages of your site.

To include Affirm.js, add the following embed code to the head of your global page template:



[See here for supported locale and country codes](🔗).

Once you include the script above, a defined instance of Affirm will be created on your client. You will gain access to methods within the Affirm object to trigger multiple actions.

## Step 2: Insert promotional messaging HTML tags

After adding Affirm.js, you’ll need to insert specific HTML tags to your site where you want the promotional messaging to display. These tags are responsible for rendering the messaging. See our [HTML reference](🔗) for more details. The following example includes: **As low as {payment}/mo with [affirm_logo]. Learn more.**

(Script tags will be stripped)


Be sure to include the `data-page-type` attribute corresponding to the page where that promotional messaging component is placed. The `data-page-type` controls the page type and pricing configuration on your site. Additionally, you to customize messaging in the future without development work. By default, promotional messaging on product pages have prequalification enabled.

### Example

To demonstrate how to include Affirm.js and the HTML tags on your site, the following example shows what a sites product detail page may look like: