Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Tracking of incognito/privat browsing

Avatar

Avatar
Validate 1
Level 2
martin_munkn548
Level 2

Likes

15 likes

Total Posts

4 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
martin_munkn548
Level 2

Likes

15 likes

Total Posts

4 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
martin_munkn548
Level 2

21-12-2016

Hi! 

Any insights or recommendations on how to track if a visitor uses incognito browsing when visiting a website? 

There are several ways to identify if the visitor ID was previously unseen (i.e. Visit Number = 1), but this does not infer the user using incognito browsing mode.

Ideally, an s.prop-value or an Omniture/Adobe Analytics plugin would be able to detect the browser mode, so a distinction between 'standard' and 'incognito'/'in-private' can be made.

Any help would be much appreciated 🙂 

Martin

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 2
martin_munkn548
Level 2

Likes

15 likes

Total Posts

4 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile

Avatar
Validate 1
Level 2
martin_munkn548
Level 2

Likes

15 likes

Total Posts

4 posts

Correct Reply

1 solution
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 10
Boost 1
View profile
martin_munkn548
Level 2

11-01-2017

Actually, I've found a workaround that works for most major browsers except IE. I've been running some tests and not seen any misdetection. 

The javascript I'm using is this - but it might have some holes I'm missing? If you're aware of this, please let me know 🙂 

Script: 

// Opera 8.0+
var isOpera = (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;

// Firefox 1.0+
var isFirefox = typeof InstallTrigger !== 'undefined';

// Safari 3.0+ "[object HTMLElementConstructor]" 
var isSafari = Object.prototype.toString.call(window.HTMLElement).indexOf('Constructor') > 0 || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!window['safari'] || safari.pushNotification);

// Internet Explorer 6-11
var isIE = /*@cc_on!@*/false || !!document.documentMode;

// Edge 20+
var isEdge = !isIE && !!window.StyleMedia;

// Chrome 1+
var isChrome = !!window.chrome && !!window.chrome.webstore;

// Blink engine detection
var isBlink = (isChrome || isOpera) && !!window.CSS;

if (!isEdge && !isIE) {
    new Promise(function (resolve) {
    var db,
    on = function(){ resolve(true) },
    off = function(){ resolve(false) },
    tryls = function tryls() {
        try {
            localStorage.length ? off() : (localStorage.x = 1, localStorage.removeItem("x"), off());
        } catch (e) {
            // Safari only enables cookie in private mode
            // if cookie is disabled then all client side storage is disabled
            // if all client side storage is disabled, then there is no point
            // in using private mode
            navigator.cookieEnabled ? on() : off();
        }
    }

    // Blink (chrome & opera)
    window.webkitRequestFileSystem ? webkitRequestFileSystem(0, 0, off, on)
    // FF
    : "MozAppearance" in document.documentElement.style ? (db = indexedDB.open("test"), db.onerror = on, db.onsuccess = off)
    // Safari
    : /constructor/i.test(window.HTMLElement) ? tryls()
    // IE10+ & edge
    : !window.indexedDB && (window.PointerEvent || window.MSPointerEvent) ? on()
    // Rest
    : off();
}).then(function (isPrivateMode) {
    if (isPrivateMode) {
    b.privateBrowsing = "Yes"
    }
});
}

Answers (1)

Answers (1)

Avatar

Avatar
Coach
Employee
ericmatisoff
Employee

Likes

149 likes

Total Posts

274 posts

Correct Reply

77 solutions
Top badges earned
Coach
Contributor
Shape 10
Shape 1
Ignite 5
View profile

Avatar
Coach
Employee
ericmatisoff
Employee

Likes

149 likes

Total Posts

274 posts

Correct Reply

77 solutions
Top badges earned
Coach
Contributor
Shape 10
Shape 1
Ignite 5
View profile
ericmatisoff
Employee

10-01-2017

Hi Martin,

Unfortunately, this is not possible due to the way that browsers completely clear all cache, cookies, and history when accessing Incognito/Privacy Mode. Other than those three items being cleared, there's no other way to identify that a user is running their browser in these modes. Here's some more information on why this is not possible: http://stackoverflow.com/a/22623958