A discussion about Facebook’s fbclid parameter causing issues with Discourse permalinks. MiG shares that when a Discourse permalink is shared on Facebook and someone clicks it, Facebook appends the fbclid parameter, resulting in a 404 error on Discourse. MiG attempts to use the Permalinks Normalization setting to remove the fbclid parameter but is unable to create the correct regex.
rmens also experiences issues with fbclid polluting Google Analytics data. MiG finds a temporary solution using a Cloudflare page rule to remove the fbclid parameter before it reaches Discourse. simon investigates the issue and suggests that the problem lies with the redirect from the shortened permalink to the actual topic URL.
MiG eventually uses the Permalinks Normalization setting to remove the fbclid parameter, but not before sharing their temporary Cloudflare solution. simon and riking discuss the expected behavior of query parameters in Discourse permalinks, and justin confirms that Permalinks Normalization is the correct feature to use in this case. MiG requests an example of how to use the Permalinks Normalization setting to remove the fbclid parameter.
So I really love the permalinks feature of Discourse.
For example, I’ve been collecting photos and videos at https://fortmactech.com/riverbreak – which forwards to the longer URL of the actual topic.
The problem I’m running into is that when that’s posted on Facebook and someone clicks it, Facebook appends its fbclid crap at the end. So the URL is something like:
So I think this is something that can probably be done with the Permalinks Normalization setting, but I can’t figure out the regex. Basically remove anything after and including ?fbclid= I think.
That makes sense. Is there a way to “transform” an incoming URL before it’s analyzed by the permalinks code? Is that the “Permalinks Normalization” feature?