Facebook ads - fbclid error

4 posts by 2 authors in: Forums > CMS Builder
Last Post: Tuesday at 4:07pm   (RSS)

By theclicklab - Tuesday at 12:05pm - edited: Tuesday at 12:05pm

Hi, Getting errors with clicks from facebook ads. What do we need to do to ignore the fbclid query string? e.g. 

https://www.luxurychartergroup.com/fr/yacht-type.php/sailing-1/?fbclid=IwZXh0bgNhZW0CMTEAAR7fTQ-i0Wqhbb9AcxZH7diA0z0D8ZZP7LoAuS2-ye-86BO_GJ8hKRYcGLq97w_aem__zv4OF5lCj9Fz28JdJBg8Q

Error:
Warning: Trying to access array offset on value of type null in /home/luxurychartergroup/luxurychartergroup.com/fr/yacht-type.php on line 28Warning: Cannot modify header information - headers already sent by (output started at /home/luxurychartergroup/luxurychartergroup.com/cms/lib/errorlog_functions.php:113) in /home/luxurychartergroup/luxurychartergroup.com/fr/yacht-type.php on line 32Warning: Cannot modify header information - headers already sent by (output started at /home/luxurychartergroup/luxurychartergroup.com/cms/lib/errorlog_functions.php:113) in /home/luxurychartergroup/luxurychartergroup.com/404.php on line 1Warning: Cannot modify header information - headers already sent by (output started at /home/luxurychartergroup/luxurychartergroup.com/cms/lib/errorlog_functions.php:113) in /home/luxurychartergroup/luxurychartergroup.com/404.php on line 2

Many Thanks :)

By theclicklab - Tuesday at 1:17pm - edited: Tuesday at 1:18pm

Thanks Rob for those tips, I solved this.

foreach($_REQUEST as $key => $item){
if($key != 'page' && $key != 'sort' && $key != 'gclid' && $key != 'fbclid' && $key != 'msclkid' && strpos($key, 'utm') === false){
$recordNum = preg_replace("/[^0-9,.]/", "",$item);
break;
}
}

Hey,

Not sure on your end goal with $recordNum, but that code will still pass fbclid (and those others) to your $recordNum, which could potentially still cause problems down the line.

Without seeing what you then do with $recordNum, I'm guessing it's used in a mysql_get/select to get the page record?

Cheers