Add handling for visits referred by Google with no search query provided

Hello!!

I thought this might be helpful for some who are struggling with "not provided" and NetInsight. Please know that there are multiple steps that can be taken to mitigate against the issue, and I will be posting more over time... just didn't see a reason to hold this helpful tidbit back.

While Google is masking search terms from landing sites, They are making an effort to provide insight into the fact that the visitor did come from Google search by setting a referrer that is equal to https://www.google.com (or https://www.google.co.uk, etc.). This has also been handled by removing the q= parameter value from the URL while leaving everything else intact, which will be a follow up either here or at tbdac.com.


What this JS modification does is pushes a "?q=not provided" (a la Google Analytics) query string on the referring URL if the document.referrer is equal to http://SOMEGOOGLEDOMAIN/ or  https://SOMEGOOGLEDOMAIN/, with nothing after the first slash following the domain... where SOMEGOOGLEDOMAIN is www.google.something (e.g. www.google.com, www.google.com.mx, www.google.co.uk, etc.)

var rx = new RegExp("https?://www.google.[^/]+/$");

if (rx.test(document.referrer)) {

NTPT_GLBLEXTRA += "&rf=" + encodeURIComponent(document.referrer) + "%3Fq%3Dnot%20provided";

}

Depending on your implementation, this type of JS snippet should be added immediately to the end of the ntpagetag.js... or to some other custom JS include that is called shortly after ntpagetag.js (it is dependent on NTPT_GLBLEXTRA having been set by ntpagetag.js). For vanilla implementations (where the page tag request occurs as the JS loads) you may need to move to something that allows for more customization by splitting the JS load from the page tag image request... see NTPT_NOINITIALTAG.

I realize this could be rewritten to be more fault tolerant. For example, we could test existence of NTPT_GLBLEXTRA... but if this is being called in tandem with ntpagetag.js that should not be necessary.

I'm open to any other suggestions/tips if anyone has them! Please feel free to write back with any questions or comments.

Tags: google, not, ntpagetag.js, provided, search

Views: 25

Reply to This

Replies to This Discussion

Hi, 

I seem to have a simple alternative for the same. 

Add the below to your Search & Replace with other required changes.

<urlsearchrule type="referrer" search="(\&amp;q\=\&amp;)" replace="&amp;q=GUser-Keyword-N/A&amp;" name="Google Loggedin">

                        <member method="contains">google.</member>

                </urlsearchrule>

Regards, 

Naveen.KK

Reply to Discussion

RSS

© 2013   Created by Wendy Ertter.   Powered by

Badges  |  Report an Issue  |  Terms of Service