Implement DNT. INCOMPLETE #199

Merged
merged 1 commit into from Jun 21, 2012

Projects

None yet

3 participants

@glogiotatidis
Member

I look for navigator.doNotTrack (or navigator.msdoNotTrack) and if not "yes" or "1" I dynamically load webtrend js files. I believe that this respects DNT but I would love some feedback.

Comments please?

@rlr rlr commented on the diff Jun 21, 2012
media/js/tracker.load.js
@@ -0,0 +1,27 @@
+// WebTrends SmartSource Data Collector Tag v10.2.10
+// Copyright (c) 2012 Webtrends Inc. All rights reserved.
+// Tag Builder Version: 4.1.0.10
+// Created: 2012.05.15
@rlr
rlr Jun 21, 2012 Member

This comment confused me. I think you modified the file, right? Probably should note that.

@rlr rlr and 2 others commented on an outdated diff Jun 21, 2012
media/js/tracker.load.js
@@ -0,0 +1,27 @@
+// WebTrends SmartSource Data Collector Tag v10.2.10
+// Copyright (c) 2012 Webtrends Inc. All rights reserved.
+// Tag Builder Version: 4.1.0.10
+// Created: 2012.05.15
+(function(){
+ if (navigator.doNotTrack != "yes" || navigator.doNotTrack != "1" || navigator.msDoNotTrack != "1") {
@rlr
rlr Jun 21, 2012 Member

I think these should all be &&'s ? If navigator.doNotTrack returns 'yes', then the second case will be true and it will track anyway.

@glogiotatidis
glogiotatidis Jun 21, 2012 Member

True! Nice catch ;)

@ednapiranha
ednapiranha Jun 21, 2012 Member

I suspect you want to also check if those exist too or you will get an undefined thrown. e.g.

var dnt = navigator.doNotTrack || navigator.msDoNotTrack;

if (!dnt || (dnt && (dnt != 'yes' || dnt != '1'))
@ednapiranha ednapiranha commented on an outdated diff Jun 21, 2012
media/js/tracker.load.js
+ var dcs=new Webtrends.dcs().init({
+ dcsid:"dcsn9zlfduz5bdwdlv6uznm5h_6i3i",
+ domain:"statse.webtrendslive.com",
+ timezone:0,
+ fpcdom:".reps.mozilla.org",
+ plugins:{
+ //hm:{src:"//s.webtrends.com/js/webtrends.hm.js"}
+ }
+ }).track();
+ };
+
+ var s=document.createElement("script");
+ s.async=true;
+ var surl =$("#webtrends-url").data('url');
+ s.src = surl.replace(/&lt;/g, '<').replace(/&gt;/g, '>').replace(/&#34;/g, '"').split('"')[1];
+ console.log(surl);
@ednapiranha
ednapiranha Jun 21, 2012 Member

when you're done testing, you should remove this too.

@ednapiranha
Member

If this displays webtrends in chrome and in firefox and then with dnt activated and does not display in firefox, then merge it in!

@glogiotatidis glogiotatidis merged commit de5e190 into mozilla:master Jun 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment