I’m building links to Entries manually in my template, from the URL Segments, as follows:
<a href="<?php echo $_SERVER["REQUEST_URI"]; ?>/info/url_title">Title</a>
However, when landing on the page from a Google Adword ad or Bing ad, the Query Strings were also being added to my links, and look like this:
http://www.domain.co.uk/products/categoryname/subcategoryname?gclid=EAIaIQobChMIqtycsr3S2AIVzrvtCh0b8g3-EAAYASAAEgKfIvD_BwE/info/url_title
I’ve managed to solve this by using the following PHP instead, to strip out the Query String:
<a href="<?php echo parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH); ?>/info/url_title">Title</a>
It seems to work so far. 😊 Hope this helps.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.