Integrating the OptiMonk Campaigns with Webhook

The Webhook integration allows you to connect OptiMonk with any marketing software. We recommend using Webhook in case OptiMonk does not have direct integration with your selected system. It can also be useful when you wish to send more data than we send by default. Use incoming Webhooks to get real-time updates.
Please note the Webhook integration requires coding your own webpage. If you do not have a developer, consider using Zapier for the integration, as it does not require any coding knowledge to set up.

How does the Webhook integration work?

A Webhook integration sends certain data to an URL you provide in the integration settings in your OptiMonk dashboard. After a visitor completes a form in one of your popups with a Webhook integration, the following data is sent by default via the POST method:

  • First name (variable: firstname)
  • Last name (variable: lastname)
  • Email address (variable: email)
  • Phone number (variable: phone)
  • URL address (variable: url)
  • Campaign name (variable: campaign[name])
  • Campaign ID (variable: campaign[id])
  • Coupon code (variable: custom_fields[coupon_code], if the campaign template is "Lumira/Vegas")
  • GDPR checkbox value (variable: custom_fields[om_policy_checkbox])
  • Dropdown (variable: dropdown)
  • Checkbox (variable: checkbox)
  • Feedback (variable: feedback)
  • Radio (variable: radio)
  • Country (variable: country)
  • City (variable: city)
  • ZIP (variable: zip)

See received entries in the form values section:

mceclip0.png

mceclip1.png

https://webhook.site/

Please note:

  • In the case of Webhook, there is no need for any extra marking, therefore the easiest way is to provide the subject's name on the input field within OptiMonk.
  • Currently, Webhook can not handle delayed data sending, meaning that if you'd like to display a multi-signup popup with email and phone input on different pages, the OptiMonk admin will run to an integration error. 
    However, data is received on Webhook. 
    In this case, your popup should contain email and phone input on the same page.

Testing the Webhook integration with the PHP sample page

Here’s how to test the Webhook integration using the OptiMonk PHP sample page:

  1. Log in to your OptiMonk dashboard at https://app.optimonk.com/login/en

  2. Select Campaigns on the left, then select the Campaign you want to use for Webhook integration:
    Screenshot_2022-06-27_at_12.56.55.png


  3. Select Edit settings on the right:

    Screenshot_2022-06-27_at_11.22.31.png

  4. Click on Add new integration under Where would you like to send the subscribers and campaign data?:

    mceclip5.png

  5. Select Webhook from the list:

    mceclip3.png

  6. Enter the name of the integration and URL of the PHP sample page: https://www.optimonk.hu/webhook_sample.php in the URL field, then click Next in the top right corner to save the changes:

    mceclip0.png
  7. Here you can find all data from your OptiMonk campaign that can transfer to Webhook. For every input field on your campaign, you can assign a field in Webhook. Once you've linked the corresponding field, the data from your OptiMonk campaign will be transferred to the right place in Webhook.

    mceclip2.png
    Once you have finalized the field associations, click Done then Next in the top right corner to finalize the changes.
  8. Test the settings by completing a popup for this campaign on your website. Please note: if you have multiple Campaigns on your site, make sure you are triggering the Campaign which you updated with the Webhook integration following the steps above. 
  9. Check if data arrived in Webhook: 
    You'll see as many logs on your Webhook as there are pages in your campaign.
    For instance: if you have a coupon code on the third page, you'll find this entry in the third log in Webhook.

    Screenshot_2022-06-27_at_11.29.50.png

Testing the Webhook integration with hookbin.com:

Here’s another way you can test the Webhook integration by using the website hookbin.com:

  1. Log in to your OptiMonk dashboard at https://app.optimonk.com/login/en

  2. Select Campaigns on the left, then select the Campaign you want to use for Webhook integration:

    Screenshot_2022-06-27_at_12.56.55.png

  3. Select Edit settings on the right:
    Screenshot_2022-06-27_at_11.22.31.png

  4. Click on Add new integration under Where would you like to send the subscribers and campaign data? then select Webhook from the list:
    mceclip3.png

  5. Open https://hookbin.com/ and click on Create new Endpoint:

    mceclip5.png

  6. Copy the Bin URL:

    mceclip5.png

  7. Return to the OptiMonk dashboard and paste the URL, then give a name to the integration:

    mceclip3.png
  8. Fill in the field identifiers to associate the input field for your OptiMonk campaign with the Webhook.
    mceclip4.png
  9. Then click Done and Next in the top right corner to save the changes.

Test the settings by completing a popup for this campaign on your website. Please note: if you have multiple campaigns on your site, make sure you are triggering the campaign which you updated with the URL following the steps above. Once you’ve completed the popup, refresh the page at HookBin. When everything is set up correctly, you should see data like this:

3._eng.JPG

You can find the data sent by OptiMonk in Body.

You can easily use Webhooks by Zapier to handle the subscriber information OptiMonk gathers for you.

That's it! :) If you have any further questions or need additional further help, just let us know at support@optimonk.com and we would be happy to assist you further.

Have more questions? Submit a request

Comments