This script will echo the full url.
$url = $_SERVER[‘HTTP_HOST’].$_SERVER[‘REQUEST_URI’];
Something like this: http://yourwebsite.com/index.php?route=product/search&tag=black%20asymmetric%20coat
There are many scripts on the web that are returning just the initial url, “http://yourwebsite.com”.
So use this one instead.