From 26900147cf89c0ab30de4019cbebb3960943c210 Mon Sep 17 00:00:00 2001 From: Igor Tchibirev Date: Mon, 15 Jul 2019 13:21:50 -0400 Subject: [PATCH 1/7] Remove _ps in _f=conf request --- modules/realvuAnalyticsAdapter.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/modules/realvuAnalyticsAdapter.js b/modules/realvuAnalyticsAdapter.js index 64df6f655b7..10e7c559344 100644 --- a/modules/realvuAnalyticsAdapter.js +++ b/modules/realvuAnalyticsAdapter.js @@ -40,7 +40,7 @@ export let lib = { let z = this; let u = navigator.userAgent; z.device = u.match(/iPad|Tablet/gi) ? 'tablet' : u.match(/iPhone|iPod|Android|Opera Mini|IEMobile/gi) ? 'mobile' : 'desktop'; - if (typeof (z.len) == 'undefined') z.len = 0; // check, meybe too much, just make it len:0, + if (typeof (z.len) == 'undefined') z.len = 0; z.ie = navigator.appVersion.match(/MSIE/); z.saf = (u.match(/Safari/) && !u.match(/Chrome/)); z.ff = u.match(/Firefox/i); @@ -54,21 +54,20 @@ export let lib = { } } z.add_evt(window.top1, 'focus', function () { - window.top1.realvu_aa.foc = 1; /* window.top1.realvu_aa.log('focus',-1); */ + window.top1.realvu_aa.foc = 1; + }); + z.add_evt(window.top1, "scroll", function () { + window.top1.realvu_aa.foc = 1; }); - // z.add_evt(window.top1, "scroll", function(){window.top1.realvu_aa.foc=1;window.top1.realvu_aa.log('scroll focus',-1);}); z.add_evt(window.top1, 'blur', function () { - window.top1.realvu_aa.foc = 0; /* window.top1.realvu_aa.log('blur',-1); */ + window.top1.realvu_aa.foc = 0; }); - // + http://www.w3.org/TR/page-visibility/ z.add_evt(window.top1.document, 'blur', function () { - window.top1.realvu_aa.foc = 0; /* window.top1.realvu_aa.log('blur',-1); */ + window.top1.realvu_aa.foc = 0; }); z.add_evt(window.top1, 'visibilitychange', function () { window.top1.realvu_aa.foc = !window.top1.document.hidden; - /* window.top1.realvu_aa.log('vis-ch '+window.top1.realvu_aa.foc,-1); */ }); - // - z.doLog = (window.top1.location.search.match(/boost_log/) || document.referrer.match(/boost_log/)) ? 1 : 0; if (z.doLog) { window.setTimeout(z.scr(window.top1.location.protocol + '//ac.realvu.net/realvu_aa_viz.js'), 500); @@ -84,11 +83,12 @@ export let lib = { update: function () { let z = this; - let de = window.top1.document.documentElement; - z.x1 = window.top1.pageXOffset ? window.top1.pageXOffset : de.scrollLeft; - z.y1 = window.top1.pageYOffset ? window.top1.pageYOffset : de.scrollTop; - let w1 = window.top1.innerWidth ? window.top1.innerWidth : de.clientWidth; - let h1 = window.top1.innerHeight ? window.top1.innerHeight : de.clientHeight; + let t = window.top1; + let de = t.document.documentElement; + z.x1 = t.pageXOffset ? t.pageXOffset : de.scrollLeft; + z.y1 = t.pageYOffset ? t.pageYOffset : de.scrollTop; + let w1 = t.innerWidth ? t.innerWidth : de.clientWidth; + let h1 = t.innerHeight ? t.innerHeight : de.clientHeight; z.x2 = z.x1 + w1; z.y2 = z.y1 + h1; }, @@ -181,8 +181,8 @@ export let lib = { '_f=' + f + '_r=' + a.riff + '_s=' + a.w + 'x' + a.h; if (a.p) s2 += '_p=' + a.p; - s2 += '_ps=' + this.enc(a.unit_id) + // 08-Jun-15 - _p= is replaced with _ps= - p-number, ps-string - '_dv=' + this.device + + if (f != 'conf') s2 += '_ps=' + this.enc(a.unit_id); + s2 += '_dv=' + this.device + // + '_a=' + this.enc(a.a) '_d=' + pin.mode + '_sr=' + this.sr + From 7d8a1555d8a538556ca6fdf0c57cf4c58d78ee2d Mon Sep 17 00:00:00 2001 From: Igor Tchibirev Date: Mon, 15 Jul 2019 14:22:01 -0400 Subject: [PATCH 2/7] Replace " --- modules/realvuAnalyticsAdapter.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/realvuAnalyticsAdapter.js b/modules/realvuAnalyticsAdapter.js index 10e7c559344..51c5a106f1f 100644 --- a/modules/realvuAnalyticsAdapter.js +++ b/modules/realvuAnalyticsAdapter.js @@ -56,7 +56,7 @@ export let lib = { z.add_evt(window.top1, 'focus', function () { window.top1.realvu_aa.foc = 1; }); - z.add_evt(window.top1, "scroll", function () { + z.add_evt(window.top1, 'scroll', function () { window.top1.realvu_aa.foc = 1; }); z.add_evt(window.top1, 'blur', function () { @@ -152,7 +152,7 @@ export let lib = { let bk = z.beacons.shift(); while (typeof bk != 'undefined') { bk.s1 = bk.s1.replace(/_sr=0*_/, '_sr=' + z.sr + '_'); - z.log(' ' + bk.a.riff + ' ' + bk.a.unit_id + /* " "+pin.mode+ */ ' ' + bk.a.w + 'x' + bk.a.h + '@' + bk.a.x + ',' + bk.a.y + + z.log(' ' + bk.a.riff + ' ' + bk.a.unit_id + /* ' '+pin.mode+ */ ' ' + bk.a.w + 'x' + bk.a.h + '@' + bk.a.x + ',' + bk.a.y + ' ' + bk.f + '', bk.a.num); if (bk.a.rnd < Math.pow(10, 1 - (z.sr.charCodeAt(0) & 7))) { z.scr(bk.s1, bk.a); @@ -191,7 +191,7 @@ export let lib = { }, enc: function (s1) { - // return escape(s1).replace(/[0-9a-f]{5,}/gi,'RANDOM').replace(/\*/g, "%2A").replace(/_/g, "%5F").replace(/\+/g, + // return escape(s1).replace(/[0-9a-f]{5,}/gi,'RANDOM').replace(/\*/g, '%2A').replace(/_/g, '%5F').replace(/\+/g, return escape(s1).replace(/\*/g, '%2A').replace(/_/g, '%5F').replace(/\+/g, '%2B').replace(/\./g, '%2E').replace(/\x2F/g, '%2F'); }, @@ -467,7 +467,7 @@ export let lib = { return null; }, - doc: function(f) { // return document of f-iframe, keep here "n" as a parameter because of call from setTimeout() + doc: function(f) { // return document of f-iframe let d = null; try { if (f.contentDocument) d = f.contentDocument; // DOM From 54780e554b64c497bd5712d41dcf12106d5c5636 Mon Sep 17 00:00:00 2001 From: Igor Tchibirev Date: Tue, 23 Jul 2019 10:21:33 -0400 Subject: [PATCH 3/7] realvuAnalyticsAdapter_spec updated --- .../modules/realvuAnalyticsAdapter_spec.js | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/spec/modules/realvuAnalyticsAdapter_spec.js b/test/spec/modules/realvuAnalyticsAdapter_spec.js index 1aa1c4be8a5..359fb329359 100644 --- a/test/spec/modules/realvuAnalyticsAdapter_spec.js +++ b/test/spec/modules/realvuAnalyticsAdapter_spec.js @@ -164,5 +164,28 @@ describe('RealVu', function() { let r = boost.readPos(a); expect(r).to.equal(true); }); + + it('send_track', function () { + const a = boost.ads[boost.len - 1]; + boost.track(a, 'show', ''); + boost.sr = 'a'; + boost.send_track(); + expect(boost.beacons.length).to.equal(0); + }); + + it('questA text', function () { + let p = document.createElement('p'); + p.innerHTML = 'ABC'; + document.body.appendChild(p); + let r = boost.questA(p.firstChild); + document.body.removeChild(p); + expect(r).to.not.equal(null); + }); + + it('_f=conf', function () { + const a = boost.ads[boost.len - 1]; + let r = boost.tru(a, 'conf'); + expect(r).to.not.include('_ps='); + }); }); }); From 69b05f98f8394a3ddd56ad575da60f21e84172a4 Mon Sep 17 00:00:00 2001 From: Igor Tchibirev Date: Sat, 12 Jun 2021 18:07:52 -0400 Subject: [PATCH 4/7] Update realvuAnalyticsAdapter.js --- modules/realvuAnalyticsAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/realvuAnalyticsAdapter.js b/modules/realvuAnalyticsAdapter.js index 95e62397c2c..78fa61c9576 100644 --- a/modules/realvuAnalyticsAdapter.js +++ b/modules/realvuAnalyticsAdapter.js @@ -42,7 +42,7 @@ export let lib = { init: function () { let z = this; let u = navigator.userAgent; - z.device = u.match(/iPad|Tablet/gi) ? 'tablet' : u.match(/iPhone|iPod|Android|Opera Mini|IEMobile/gi) ? 'mobile' : 'desktop'; + z.device = u.match(/iPhone|iPod|Android|Opera Mini|IEMobile/gi) ? 'mobile' : 'desktop'; if (typeof (z.len) == 'undefined') z.len = 0; z.ie = navigator.appVersion.match(/MSIE/); z.saf = (u.match(/Safari/) && !u.match(/Chrome/)); From 9a0e26e8b29c4956660ef6406aa5eb104424d3a7 Mon Sep 17 00:00:00 2001 From: Igor Tchibirev Date: Wed, 23 Jun 2021 09:59:42 -0400 Subject: [PATCH 5/7] Update realvuAnalyticsAdapter.js Improve value returned by addUnitById() --- modules/realvuAnalyticsAdapter.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/realvuAnalyticsAdapter.js b/modules/realvuAnalyticsAdapter.js index 78fa61c9576..099bfda5e32 100644 --- a/modules/realvuAnalyticsAdapter.js +++ b/modules/realvuAnalyticsAdapter.js @@ -670,7 +670,7 @@ export let lib = { }; } let a = window.top1.realvu_aa.check(p1); - return a.r; + return a.riff; }, checkBidIn: function(partnerId, args, b) { // process a bid from hb From d775ab362ba92a1b293b78431f6c9cfb83a258e1 Mon Sep 17 00:00:00 2001 From: Igor Tchibirev Date: Thu, 15 Jul 2021 09:03:28 -0400 Subject: [PATCH 6/7] Update realvuAnalyticsAdapter.js improve flagging of 'display:none' containers --- modules/realvuAnalyticsAdapter.js | 62 ++++++++++++++++++++----------- 1 file changed, 40 insertions(+), 22 deletions(-) diff --git a/modules/realvuAnalyticsAdapter.js b/modules/realvuAnalyticsAdapter.js index 099bfda5e32..749a27ecb27 100644 --- a/modules/realvuAnalyticsAdapter.js +++ b/modules/realvuAnalyticsAdapter.js @@ -306,28 +306,46 @@ export let lib = { if (!restored) { a.target = z.questA(a.div); let target = (a.target !== null) ? a.target : a.div; - a.box.w = Math.max(target.offsetWidth, a.w); - a.box.h = Math.max(target.offsetHeight, a.h); - let q = z.findPosG(target); - let pad = {}; - pad.t = z.padd(target, 'Top'); - pad.l = z.padd(target, 'Left'); - pad.r = z.padd(target, 'Right'); - pad.b = z.padd(target, 'Bottom'); - let ax = q.x + pad.l; - let ay = q.y + pad.t; - a.box.x = ax; - a.box.y = ay; - if (a.box.w > a.w && a.box.w > 1) { - ax += (a.box.w - a.w - pad.l - pad.r) / 2; - } - if (a.box.h > a.h && a.box.h > 1) { - ay += (a.box.h - a.h - pad.t - pad.b) / 2; - } - if ((ax > 0 && ay > 0) && (a.x != ax || a.y != ay)) { - a.x = ax; - a.y = ay; - z.writePos(a); + if (window.getComputedStyle(target).display == 'none') { + let targSibl = target.previousElementSibling; // for 'none' containers on mobile define y as previous sibling y+h + if (targSibl) { + let q = z.findPosG(targSibl); + a.x = q.x; + a.y = q.y + targSibl.offsetHeight; + } else { + target = target.parentNode; + let q = z.findPosG(target); + a.x = q.x; + a.y = q.y; + } + a.box.x = a.x; + a.box.y = a.y; + a.box.w = a.w; + a.box.h = a.h; + } else { + a.box.w = Math.max(target.offsetWidth, a.w); + a.box.h = Math.max(target.offsetHeight, a.h); + let q = z.findPosG(target); + let pad = {}; + pad.t = z.padd(target, 'Top'); + pad.l = z.padd(target, 'Left'); + pad.r = z.padd(target, 'Right'); + pad.b = z.padd(target, 'Bottom'); + let ax = q.x + pad.l; + let ay = q.y + pad.t; + a.box.x = ax; + a.box.y = ay; + if (a.box.w > a.w && a.box.w > 1) { + ax += (a.box.w - a.w - pad.l - pad.r) / 2; + } + if (a.box.h > a.h && a.box.h > 1) { + ay += (a.box.h - a.h - pad.t - pad.b) / 2; + } + if ((ax > 0 && ay > 0) && (a.x != ax || a.y != ay)) { + a.x = ax; + a.y = ay; + z.writePos(a); + } } } let vtr = ((a.box.w * a.box.h) < 242500) ? 49 : 29; // treashfold more then 49% and more then 29% for "oversized" From dada1f315fd7a73f4b40697b18462817db7be6ea Mon Sep 17 00:00:00 2001 From: Igor Tchibirev Date: Thu, 15 Jul 2021 09:57:14 -0400 Subject: [PATCH 7/7] Update realvuAnalyticsAdapter.js --- modules/realvuAnalyticsAdapter.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/realvuAnalyticsAdapter.js b/modules/realvuAnalyticsAdapter.js index 749a27ecb27..5540d136dea 100644 --- a/modules/realvuAnalyticsAdapter.js +++ b/modules/realvuAnalyticsAdapter.js @@ -317,12 +317,12 @@ export let lib = { let q = z.findPosG(target); a.x = q.x; a.y = q.y; - } + } a.box.x = a.x; a.box.y = a.y; a.box.w = a.w; a.box.h = a.h; - } else { + } else { a.box.w = Math.max(target.offsetWidth, a.w); a.box.h = Math.max(target.offsetHeight, a.h); let q = z.findPosG(target);