You can target visitors from a certain source with your feedback campaigns. In this example, we'll target all visitors from google.com. First, we'll use the document.referrer
property in JavaScript.
This property will return a string containing the URL of the referral page. If that page was google.com, the string could look like https://www.google.com/
We can then use JavaScript to look at the value of this property for each visitor and trigger the Feedback campaign accordingly. In this case, we'll look for the value 'google.com'
<script type="text/javascript"> if (document.referrer.indexOf('google.com') > -1) { window._mfq = window._mfq || []; window._mfq.push(['activateFeedback', 'QMBELz7bIUufA-Mpn9Yplg']); }
</script>
The above code will trigger the Feedback campaign for each visitor from google.com.