In some cases, you may want to trigger the feedback campaign when the user or website visitor clicks a specific element on your app or website. To do this, you can use the below code examples to further customize how our Feedback campaigns are triggered.
To trigger a campaign on a click event, create a click handler for the element that should be clicked. In this example, we'll have the user click a button:
<button id="feedback_button" type="button">Start Feedback Campaign</button>
Using the ID of this button, we can create a click handler:
<script type="text/javascript"> $('#feedback_button').click(function() { window._mfq = window._mfq || []; window._mfq.push(['activateFeedback', 'QMBELz7bIUufA-Mpn9Yplg']); }); </script>
This will launch the feedback campaign by the campaign ID for the user.
Note: Triggering a campaign manually will not override any other limitations in the campaign, like page rules.