I have a cookie (_gaexp), which I want to extract values from:
GAX1.3.yK3HnOfSRZCVUMNkK3tVCA.18961.ss12!QV1ffpISQcCGmM4IOTuUlQ.18961.0!F9l4roGRR5K03cSaZMWQiA.18961.1
I specifically want to extract the characters, before 18961 only, which I can do.
But I don't want GAX1.3 included in my result.
For example, I have the following code:
let read = readCookie("_gaexp").split("!");
read.forEach(function(key, index) {
splitBeginningOfCookie = read[0].split('.')
optimizeID = splitBeginningOfCookie[3];
let variantID = key.split(optimizeID+".")[1];
let id = key.split("."+optimizeID)[0];
console.log("variantID", variantID);
console.log("id", id);
});
Which console.logs:
variantID ss12
id GAX1.3.yK3HnOfSRZCVUMNkK3tVCA
variantID 0
id QV1ffpISQcCGmM4IOTuUlQ
8 variantID 1
id F9l4roGRR5K03cSaZMWQiA
I want to exclude GA1.3. from the first loop though. What is the best way, to grab the long IDs only, from this string?
The last 2 loops are fine. It's just the first one, which returns everything before 18961.
Thanks,
