Part 1: How to install the script
Part 2: How to install the setEmail script
Part 3: How to install the setEmail script within Klarna Checkout
Part 1: How to install the script
- Copy the snippet below and replace PUBLIC_ID with your actual Public ID (How to find your Public ID)
<!-- Start ProfitMetrics - snippet - (v1) -->
<script>
window.profitMetrics = {
pid: 'PUBLIC_ID',
emailInputSelector: '#gui-form-customer-email, #gui-form-email',
}
</script>
<script src="https://cdn1.profitmetrics.io/PUBLIC_ID/bundle.js" defer></script>
<!-- End ProfitMetrics - snippet - (v1) --> -
Click "Instellingen"
- Click "Web-extras"
- Paste the code in "Custom javascript" > "Javascript"
Part 2: How to install the setEmail script
- Copy this snippet
<!-- Start ProfitMetrics - setEmail - (v1) -->
<script>
function _pm_tryemailorderconfirmation() {
if( null != window.profitMetrics && null != window.profitMetrics.setEmail && typeof window.profitMetrics.setEmail === 'function' ) {
window.profitMetrics.setEmail( '' );
} else {
setTimeout( _pm_tryemailorderconfirmation, 500 );
}
}
_pm_tryemailorderconfirmation();
</script>
<!-- End ProfitMetrics - setEmail - (v1) --> - Paste the "setEmail" script in "TRACKING" > "Tracking code"
- Ensure the status is "Enabled"
Part 3: How to install the setEmail script within Klarna Checkout
- Copy the snippet below
window._klarnaCheckout(function(api) {
api.on({
'change': function(data) {
profitMetrics.setEmail( data.email );
window.dataLayer = window.dataLayer || [];
dataLayer.push({
'event': 'klarnaCheckout',
'klarnaCheckout': {'email': 'data.email'},
});
}
});
}); - Paste it inside of the Klarna checkout <iframe>
- If your Hybrid Server-side Universal Integration Script is set up through Google Tag Manager you will need to create a DataLayer variable for
klarnaCheckout.email
and insert it in the Tag.