[interchange] Add BounceReferralsRobot directive
Jon Jensen <[email protected]>
| Newsgroups | gmane.comp.web.interchange.cvs |
|---|---|
| Message-ID | <[email protected]> |
commit 8791783c77149c7e38bf897de42a897d98786609 Author: Jeff Boes <[email protected]> Date: Tue Jun 8 12:05:09 2010 -0600 Add BounceReferralsRobot directive Redirects when referrals are present in the URL only for robots. This is useful for Google Analytics, Omniture SiteCatalyst, and similar analytics that need to see the referrals in the URL, and doesn't hurt anything for most users because redirecting away from the referral is most important for SEO. Signed-off-by: Jon Jensen <[email protected]> lib/Vend/Config.pm | 3 ++- lib/Vend/Dispatch.pm | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) --- diff --git a/lib/Vend/Config.pm b/lib/Vend/Config.pm index e39ee09..c27c247 100644 --- a/lib/Vend/Config.pm +++ b/lib/Vend/Config.pm @@ -713,6 +713,7 @@ sub catalog_directives { ['UserTrack', 'yesno', 'no'], ['DebugHost', 'ip_address_regexp', ''], ['BounceReferrals', 'yesno', 'no'], + ['BounceReferralsRobot', 'yesno', 'no'], ['BounceRobotSessionURL', 'yesno', 'no'], ['OrderCleanup', 'routine_array', ''], ['SessionCookieSecure', 'yesno', 'no'], @@ -1346,7 +1347,7 @@ CONFIGLOOP: } } - # Set up hash of keys to hide for BounceReferrals + # Set up hash of keys to hide for BounceReferrals and BounceReferralsRobot $C->{BounceReferrals_hide} = { map { ($_, 1) } grep { !(/^cookie-/ or /^session(?:$|-)/) } @{$C->{SourcePriority}} }; my @exclude = qw( mv_form_charset mv_session_id mv_tmp_session ); @{$C->{BounceReferrals_hide}}{@exclude} = (1) x @exclude; diff --git a/lib/Vend/Dispatch.pm b/lib/Vend/Dispatch.pm index cf73c1e..d19a495 100644 --- a/lib/Vend/Dispatch.pm +++ b/lib/Vend/Dispatch.pm @@ -1567,11 +1567,12 @@ EOF @{$sc}{qw(expire domain path secure)} ); } - + if ( ($new_source and $CGI::request_method eq 'GET' - and $Vend::Cfg->{BounceReferrals}) or + and ($Vend::Cfg->{BounceReferrals} or + ($Vend::Robot and $Vend::Cfg->{BounceReferralsRobot}))) or ($Vend::Robot and $sessionid_from_cgi and $Vend::Cfg->{BounceRobotSessionURL}) ) { my $path = $CGI::path_info;