Follow the steps below to set up an integration with Vendre
Part 2: Install the Tracking script
Part 3: Install the setEmail script
Part 1: Create a webhook
- Click "Apps & Integrations"
-
Click "Webhooks"
-
Click "New webhook"
-
Select the "New order" option
-
Click "New webhook"
- Copy the URL below and paste it into the URL field and replace "PUBLICID" with your Public ID (How to find your Public ID)
https://my.profitmetrics.io/l.php?v=3uh&cv=vendre&pid=PUBLICID
- Under Data filter, select "ProfitMetrics"
- Under Method, select GET
- Click "Add"
Part 2: Install the Serverside Hybrid Universal Integration Script
- Copy this snippet and remember to replace PUBLICID with your Public ID (How to find your Public ID)
<!-- START ProfitMetrics - Script -->
<script>
window.profitMetrics = {
pid: 'PUBLIC_ID', // Your Public ID
emailInputSelector: 'input',
onLoad: () => {
const email = '#customer_email_address';
if (email && email.includes('@') && email.includes('.') && !/\s/.test(email)) {
profitMetrics.setEmail(email);
}
}
}
if (typeof window._klarnaCheckout === 'function') {window._klarnaCheckout(function(api) {api.on({'change': function(data) {profitMetrics.setEmail(data.email);}});});}
</script>
<script src="https://cdn1.profitmetrics.io/PUBLIC_ID/bundle.js"
defer></script>
<!-- END ProfitMetrics - Script--> - Click "Settings"
-
Click "Tracking Codes"
- Paste the code into "Tracking code in HEAD on each side"
- Click "Spara"
Part 3: Install the setEmail script
- Copy this snippet
<!-- Start ProfitMetrics - setEmail -->
<script>
function _pm_tryemailorderconfirmation() {
if (null != window.profitMetrics && null != window.profitMetrics.setEmail && typeof window.profitMetrics.setEmail === 'function') {
window.profitMetrics.setEmail('#customer_email_address');
} else {
setTimeout(_pm_tryemailorderconfirmation, 500);
}
}
_pm_tryemailorderconfirmation();
</script>
<!-- End ProfitMetrics - setEmail --> - Click "Settings"
-
Click "Tracking Codes"
- Paste the code into "Tracking code at the end of BODY on Thank you for order"
- Click "Spara"
That's it.