How to integrate ProfitMetrics with Vendre

Follow the steps below to set up an integration with Vendre

Part 1: Create a webhook

Part 2: Install the Tracking script

Part 3: Install the setEmail script


Part 1: Create a webhook

  1. Click "Apps & Integrations"
    Setting Up New Webhook in ProfitMetrics Admin - Step 4
  2. Click "Webhooks"
    Setting Up New Webhook in ProfitMetrics Admin - Step 5

  3. Click "New webhook"
    Setting Up New Webhook in ProfitMetrics Admin - Step 6

  4. Select the "New order" option
    Setting Up New Webhook in ProfitMetrics Admin - Step 7

  5. Click "New webhook"
    Setting Up New Webhook in ProfitMetrics Admin - Step 8

  6. 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
  7. Under Data filter, select "ProfitMetrics"
    Google Chrome Workflow - Step 3 (1)
  8. Under Method, select GET
    Google Chrome Workflow - Step 5 (3)
  9. Click "Add"
    Google Chrome Workflow - Step 8

Part 2: Install the Serverside Hybrid Universal Integration Script

  1. 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-->
  2. Click "Settings"
    How to Configure Tracking Codes in Webhooks - Step 2
  3. Click "Tracking Codes"
    How to Configure Tracking Codes in Webhooks - Step 3

  4. Paste the code into "Tracking code in HEAD on each side"
    How to Configure Tracking Codes in Webhooks - Step 7
  5. Click "Spara"
    How to Configure Tracking Codes in Webhooks - Step 16

Part 3: Install the setEmail script

  1. 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 -->
  2. Click "Settings"
    How to Configure Tracking Codes in Webhooks - Step 2
  3. Click "Tracking Codes"
    How to Configure Tracking Codes in Webhooks - Step 3

  4. Paste the code into "Tracking code at the end of BODY on Thank you for order"
    How to Update Tracking Codes in Profit Metrics - Step 9
  5. Click "Spara"
    How to Update Tracking Codes in Profit Metrics - Step 10

That's it.