My website is receiving referral traffic in the format:
/page/fbclid, undefined, nm
/page/fbclid, undefined, nm?next=/string1/string2/
I've tried GA's Exclude URL Query Parameters to no avail
So I ended up writing a script to remove fbclid
before sending data to GA basis off this GA documentation
/**
* Checks to see if the Facebook parameter 'fbclid' is
* found in the path, if it is, remove it.
**/
if (document.location.pathname.indexOf("fbclid") > -1) {
let pathName = document.location.pathname;
/** Cleans path
* From "/courses/fbclid, undefined, nm?fbclid=IwAR3CqQ-jm051SOOL7i.../"
* to "/courses/"
**/
pathName = pathName.substring(0, pathName.indexOf("fbclid"));
ga('send', 'pageview', pathName);
} else {
ga('send', 'pageview');
}
fbclid
as a query parameter when it doesn't have a?
before it - but I have also never seen it without a?
before it, because typically Facebook adds it automatically (and hence in a standard syntax). It makes me wonder whether these are truly clicks through from Facebook. Are these pages showing up in your Behavior > Site Content > Landing Pages report? Do you include GA directly or use Google Tag Manager??
before it" - these are not query string parameters. Onlyname
in the 2nd URL is a "query string parameter". Do these URLs only appear in the GA report? Or do they also appear in your server access logs? Are these URLs theReferer
URL, from which the traffic is coming? Or the target URL (ie. "referral traffic") on your site?