Marketing Elements
Marketing elements are an effective way of boosting awareness of Hokodo and giving information on how to pay with Hokodo at checkout. Making buyers aware that flexible payment options are available will also help to increase both the Conversion Rate and the Average Order Value.
Marketing elements should be visible at multiple stages of the buyer’s journey, including the homepage, trade/wholesale pages, and product pages. Displaying them as early as possible in the buyer’s journey will have the biggest impact on the take-up rate at checkout.
Setup
Follow these steps to get the Hokodo SDK as a JavaScript object on your page.
Include the Hokodo SDK in your page
Include the Hokodo script on pages where you wish to access the SDK. It should always be loaded directly from
https://js.hokodo.co
or js-sandbox.hokodo.co/hokodo-js/v1/
, rather than being included in a bundle or hosted yourself.
<!--Sandbox URL for use whilst developing-->
<script src="https://js-sandbox.hokodo.co/hokodo-js/v1" />
<!--Production URL-->
<script src="https://js.hokodo.co/hokodo-js/v1" />
The script tag should be part of your initial DOM structure rather than added dynamically via JavaScript, as dynamically added script tags can be blocked by ad blockers since they're viewed as third-party scripts at that point.
When using async
or defer
tags, any SDK methods must only be executed after the script has finished loading.
You'll need to account for this in your code if you use these attributes.
You will now have an object named Hokodo
in the global scope:
window.Hokodo;
// or
Hokodo;
Instantiate the SDK object with your Public Key
Pass your SDK Public Token into the Hokodo
object to instantiate it:
const hokodo = Hokodo("pk_test_xxxx", {
locale: "en-GB",
currency: "GBP",
});
If you have already identified the buyer with Hokodo platform, you can pass in userId
, organisationId
and companyId
to the Hokodo
object at the time of instantiation. This allows the credit limit banners to display the credit limit without going through the company selection flow.
const hokodo = Hokodo("pk_test_xxxx", {
locale: "en-GB",
currency: "GBP",
userId: "user-xxxx",
organisationId: "org-xxxx",
companyId: "co-xxxx",
});
Global options
The following global options are available on the Hokodo
object:
Parameter | Required | Default | Description |
---|---|---|---|
locale | false | en-GB | Language and region of the customer. Supported locales are en-GB , es , fr , de and nl . |
currency | false | GBP | Currency to be displayed in the marketing elements. Supported values are GBP and EUR . |
userId | false | Hokodo User object ID. | |
organisationId | false | Hokodo Organisation object ID. | |
companyId | false | Hokodo Company object ID. | |
bannerLink | false | https://www.hokodo.co/hokodo-for-buyers | This page opens when a buyer clicks on the banner.This option is not applicable for lightbox, FAQ, badge, product description page banner, and discount banners. |
faqLink | false | https://www.hokodo.co/hokodo-for-buyers | Use this option to provide a URL for the FAQ page. |
countryOptions | false | Use this option to provide the list of allowed countries in the company search for credit limit banners. e.g. ["GB", "ES", "FR", "DE", "NL", "BE"] | |
country | false | GB | Use this option to provide the preselected country in the company search for credit limit banners. |
Initialise marketing elements
The marketing materials provided by the SDK can now be initialised using:
hokodo.marketing();
Content security policy
If you deploy a content security policy, you will need to add the following in order to fully support Hokodo's frontend SDK:
For Sandbox
connect-src
https://js-sandbox.hokodo.co, https://i-pay-sandbox.hokodo.coframe-src
https://js-sandbox.hokodo.co, https://i-pay-sandbox.hokodo.coscript-src
https://js-sandbox.hokodo.cofont-src
https://fonts.gstatic.comstyle-src
https://fonts.googleapis.com
For Production
connect-src
https://js.hokodo.co, https://i-pay.hokodo.coframe-src
https://js.hokodo.co, https://i-pay.hokodo.coscript-src
https://js.hokodo.cofont-src
https://fonts.gstatic.comstyle-src
https://fonts.googleapis.com
Updating global options
If you want to update the global options at any point after initialisation you can use the hokodo.update
method:
hokodo.update({
locale: "fr",
currency: "EUR",
});
Marketing Elements
Here, we have put together a set of ready-made responsive marketing elements which you can add to your site when you launch Hokodo, as well as some guidance on when and where to use them.
Payment plan details within marketing material are populated based on your contract e.g. Pay in 30 days
or Pay in 60 days
.
Available element types
The element types provided by the SDK can be grouped into four different categories: the standard static banners, banners that allow buyers to check their credit limits, frequently asked questions element and multiple variations of banners to display promotional discount from Hokodo.
Standard
- Top Strip:
top-strip
,mobile-top-strip
- Leaderboard:
leaderboard-small
,leaderboard-medium
,leaderboard-large
,leaderboard-xlarge
,mobile-leaderboard-small
,mobile-leaderboard-medium
- Rectangle:
rectangle-small
,rectangle-medium
,rectangle-large
,rectangle-xlarge
- Square:
square-small
,square-medium
- Portrait:
portrait
- Vertical Banner:
vertical-banner
- Hero:
hero
- Cover:
cover
- Mobile Banner:
mobile-banner
- Lightbox:
lightbox
- Badge:
badge-small
,badge-large
Frequently Asked Questions
Credit Limit
- Product Description Page Banner:
credit-limit-banner
- Top Strip:
credit-limit-top-strip
- Modal:
credit-limit-modal
Discount
- Leaderboard:
discount-leaderboard-small
- Rectangle:
discount-rectangle-small
- Square:
discount-square-medium
- Mobile Banner:
discount-mobile-banner
- Product Description Page Banner:
discount-product-banner
- Top Strip:
discount-top-strip