(A|B) testing Google Analytics, remove utm_expid from URL

Giorgi picture Giorgi · Jan 8, 2013 · Viewed 8.3k times · Source

Im new to this and im trying to rewrite URL so that utm_expid is hidden so if my url is:

http://www.myweb.com/?utm_expid=67183125-2

how would i make it so when user visits

myweb.com

it does not show utm_expid in url

Is this possible using PHP/JS?

NOTE: i cant use RUBY or any other languages except PHP/JS/HTML

Answer

Vishnu R picture Vishnu R · Jan 8, 2013

There is a way. Just redirect the page to base url once the utm_expid=67183125-2 is got. ie,

if($_GET['utm_expid']) { //header to redirect to myweb.com }

Its a tricky way. Hope you are permitted to use it.

Just start a session and store value in session variable. you can regain it even page is re directed.

ie

<?php
session_start();
if($_GET['utm_expid']) {
$_SESSION['variable_name']=$_GET['utm_expid']
 //header to redirect to myweb.com 
}
?>