Shorten Google Analytics tracking URL (variables only)

2

I would like to shorten a URL from my WordPress site as follows:

www.meusite.com/?utm_source=FONTE&utm_medium=MEDIUM&utm_campaign=CAMPANHA

for something like

www.meusite.com/?urlencurtada

Where ?urlencurtada will receive the entire parameter of ?utm_source=FONTE&utm_medium=MEDIUM&utm_campaign=CAMPANHA

The reason for this is that I want to share links on my site hiding this extensive amount of Analytics variables for an alias that executes them when called.

example as wish to stay:

www.meusite.com/umlinkquepassaseguranca/?urlencurtada
www.meusite.com/?urlencurtada
www.meusite.com/umamateriaLimpanaURL/?urlencurtada
www.meusite.com/um-artigo-com-endereco-enorme/?urlencurtada

So it will get better than something like:

www.meusite.com/um-artigo-com-endereco-enorme/?urlencurtada

instead of:

www.meusite.com/um-artigo-com-endereco-enorme/?utm_source=FONTE&utm_medium=MEDIUM&utm_campaign=CAMPANHA

The purpose of this is to do a crawl while maintaining the elegance of the url. This will influence the sharing of the same, and the security that will pass to those who see them ..

    
asked by anonymous 06.02.2016 / 04:23

1 answer

2

You could use a GET and Redirect together, this way:

www.meusite.com/?curler=1

No php:

<?php
 if (!empty($_GET['encurtador']) {

   if($_GET['encurtador'] == 1) { header("location:www.meusite.com/?utm_source=FONTE&utm_medium=MEDIUM&utm_campaign=CAMPANHA");  }

}
?>
    
06.02.2016 / 12:20