I need a solution to parse the value in the URL split between %2526_ga%253d and &wct then append &_ga= + the parsed value to the end of the same URL.
This is my URL, which is always different but %2526_ga%253d and &wct is always the same.
http://www.example.com/wa=wsignin1.0%2526_ga%253d1.193373933.1506621463.1391436765&wct=2014-04-25T19
The end result would be:
http://www.example.com/wa=wsignin1.0%2526_ga%253d1.193373933.1506621463.1391436765&wct=2014-04-25T19&_ga=1.193373933.1506621463.1391436765
I completed my solution and this works:
var gacookie = window.location.search.match('_ga%253d(.+)&wct=');
var url = window.location.href;
if (url.indexOf('_ga') > -1) {
url += '&_ga=' + gacookie[1]
parent.location.hash = url
var hash = location.hash.replace('#', gacookie[1]);
if(hash != '') {
location.hash = '&_ga=' + gacookie[1];
}
}