Embedded Acquisition

Learn how to embed our Acquisition Journey onto your website within an iFrame.

Overview

If you are a NewDay partner and you can host our Acquisition Journey within an iFrame for customer onboarding. The steps to build this journey are outlined below.

Background

Under current GDPR and CPRA regulations, browsers are required to automatically block cookies set by third-party domains. Our acquisition application relies on cookies. If you want to embed it within an iFrame, there are some pre-requisites for the application to be functional.

If the domain setting the cookie in the browser (the iFrame src) differs from the hosting domain (your website, where the iFrame is embedded), the browser prevents the cookie from being set. This can be avoided by making some adjustments at the DNS record and certificate levels, as documented in the step-by-step guide below.

Step-by-Step Guide

Suppose your website's root domain is www.mywebsite.co.uk, and you want to embed our Acquisition Journey into an iFrame on a specific page, such as www.mywebsite.co.uk/apply.

1

Choose a Subdomain for the Embedded App

Select a subdomain within your domain, such as apply.mywebsite.co.uk. This will host our application securely in an iFrame.

2

Add a Verification CNAME Record

Create a CNAME record for verification so we can configure our Front Door for this subdomain. This proves domain ownership.

In your DNS settings, add a CNAME record:

Name: afdverify.apply

Points to: the Front Door resource we provide, e.g.,afdverify.apply.newdaycards.co.uk


This is a one-time setup for verification.

3

NewDay Provides a Certificate Signing Request (CSR)

NewDay will send you a Certificate Signing Request (CSR) file, which you can use to obtain a digital certificate (SSL/TLS) for apply.mywebsite.co.uk.

4

Purchase the SSL/TLS Certificate

Coordinate with your account manager for the purchase an SSL/TLS certificate for apply.mywebsite.co.uk using the CSR provided. Once the certificate is ready, we will upload it into our deployment system, and configure it to work with apply.mywebsite.co.uk.

5

Create a CNAME to Route Your Subdomain to NewDay’s Service

In your DNS settings, add a CNAME record to route traffic for apply.mywebsite.co.uk to our Front Door:

Name: apply

Points to: the Front Door resource we provide, e.g.,apply.newdaycards.co.uk

This setup ensures traffic for apply.mywebsite.co.uk is directed to our application.

Additional Information

Repeat for Each Environment: You’ll need to repeat these steps for any additional environments (such as testing or production).

Ownership: DNS and SSL/TLS certificate management is handled by you, the root domain owner.

SSL/TLS Certificates: These certificates secure your subdomain, enabling encrypted (HTTPS) connections, which ensures data privacy and allows cookies to function properly across browsers.

Embed our Acquisition Journey

To embed the application, copy and paste the code below into the UI where you want the widget to be displayed.

Javascript

1<iframe src="https://apply.mywebsite.co.uk/<brand>/online/<product>/quote"></iframe>
ParameterDescription
brand
(required)
Your brand in a lowercased string format
product
(required)
Your product in a lowercased string format

Communication from our widget to the parent page

End of journey update

We will send a post message to the parent page to notify of the end of the journey in the following format.

Code Sample

Node + Request

1{
2  success: <false|true>,
3  status: <status>,
4  message: <message>,
5  appId: <applicationId>,
6  customerRef: <customerRef>,
7}
StatusMeaning
techErrorUnexpected Technical Error
quotedeclineApplicant declined at check eligibility
dupeapplicationAn application with for the same applicant already exists
declineApplicant declined at apply
adverseBureauApplicant declined at apply
affordabilityApplicant declined at apply
otherBureauApplicant declined at apply
scoreApplicant declined at apply
referNot possible to onboard the applicant, more checks required
appexpiredThe application has expired
appcompleteThe application has been completed, but boarding failed
appboardedThe application has been completed and boarded (only successful scenario)

Giving back control

Our widget will request the parent to take back control and redirect the user to a different screen (e.g. change payment method) using a post message in the following format.

Code Sample

Node + Request

1{
2  action: <action>,
3  appId: <applicationId>,
4  customerRef: <customerRef>,
5}
ActionMeaning
changePaymentMethodThe application could not be completeted and the user has clicked on the button to go back to the payment method screen
amendMyBasketThe application has been completeted but the basket amount is bigger than the credit limit. The user has clicked the button to change the content of the basket.
redirectToCheckoutThe application has been completeted and the checkout page should be displayed to the user

Still have questions

Can’t find the answer to your question? Our friendly team are more than happy to help

Was this page helpful?