Expand my Community achievements bar.

Test Entry with Activity ID

Avatar

Level 4

Hello Forum,

My team is working on a proof of concept to minimize the amount of page flicker that occurs before Target fires and shows alternate content. So far, we've been able to hard-code into our SPA the ability to hide original content before we show the alternative. But, this would happen for every user if we pushed to production. Not what we want.

Based on the above explanation, is there a way to capture the Activity ID to control test entry to only those who qualify? I should note that we use a third-party tag manager, and it's been suggested that we do so there. However, we're wondering is there's another way?

Below is a very crude example of what we're doing:

// Declare private variable for page, url, activity ID and CSS selector

var objPageSelectors = {

    "payment page" : {

        "page_url": "www.website.com",

        "191854": ".selector"

    }

};

// Add style attribute so opacity can be set

var style = document.createElement("style");

var hideEnabled = false;

style.setAttribute("media", "screen");

style.setAttribute("id", "campaign-flicker-hide-style");

// WebKit hack

style.appendChild(document.createTextNode(""));

document.head.appendChild(style);

// If page URL or ID matches what users will see

// add the matching CSS selector(s) to the style

if (style) {

    try

    var sheet = style.sheet;

    sheet.insertRule(".selector {opacity: 0}", 0);

catch(e) {

        sheet.deleteRule(0);

    }

}

Thanks in advance!

- Brion

0 Replies