Hi I am trying to display different content on my site, if the user has visited from my Google Adwords campaign.
I used document.referrer in the Chrome console to find the referrer and placed this info in the code below
If I set the referrer to be Google.com and visit from there then the script performs - however when trying to match with the Google Adwords referrer URL, it doesn't work.
I was thinking I could attempt to match the string length, or just the '/?gclid=' part of the string
<?php
// This is to check if the request is coming from a specific URL
$ref = $_SERVER['HTTP_REFERER'];
if($ref == 'http://domain.nl/?gclid=CjwKEAiApOq2BRDoo8SVjZHV7TkSJABLe2iDnbfXanR14L-Di0IaoXGFTRx_uF_SGJ6QrmMstGDQChoCbBzw_wcB') {
echo "yes";
}
else {
echo "no";
}
?>