diff options
author | benakamoorthi <benaka.moorthi@gmail.com> | 2012-11-24 12:01:10 +0400 |
---|---|---|
committer | benakamoorthi <benaka.moorthi@gmail.com> | 2012-11-24 12:01:10 +0400 |
commit | 4f4959338dd5d0b5acb8747d21b865d5a06e89a6 (patch) | |
tree | 1d5630ce62c2330522829f82abf3ec40498a9903 /plugins | |
parent | 842ece5d0052864b9c70cce3c318bd9918b985e5 (diff) |
Fixes #2375, added ability to exclude visits from tracking based on global & site-specific blacklists user agent substrings. Also fixed bug in website management page that broke website editing/creation.
git-svn-id: http://dev.piwik.org/svn/trunk@7535 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/SitesManager/API.php | 90 | ||||
-rw-r--r-- | plugins/SitesManager/Controller.php | 11 | ||||
-rw-r--r-- | plugins/SitesManager/SitesManager.php | 32 | ||||
-rw-r--r-- | plugins/SitesManager/templates/SitesManager.js | 21 | ||||
-rw-r--r-- | plugins/SitesManager/templates/SitesManager.tpl | 33 |
5 files changed, 176 insertions, 11 deletions
diff --git a/plugins/SitesManager/API.php b/plugins/SitesManager/API.php index 8242893b21..9a8a95a77d 100644 --- a/plugins/SitesManager/API.php +++ b/plugins/SitesManager/API.php @@ -49,6 +49,8 @@ class Piwik_SitesManager_API const OPTION_EXCLUDED_QUERY_PARAMETERS_GLOBAL = 'SitesManager_ExcludedQueryParameters'; const OPTION_SEARCH_KEYWORD_QUERY_PARAMETERS_GLOBAL = 'SitesManager_SearchKeywordParameters'; const OPTION_SEARCH_CATEGORY_QUERY_PARAMETERS_GLOBAL = 'SitesManager_SearchCategoryParameters'; + const OPTION_EXCLUDED_USER_AGENTS_GLOBAL = 'SitesManager_ExcludedUserAgentsGlobal'; + const OPTION_SITE_SPECIFIC_USER_AGENT_EXCLUDE_ENABLE = 'SitesManager_EnableSiteSpecificUserAgentExclude'; /** * Returns the javascript tag for the given idSite. @@ -451,7 +453,19 @@ class Piwik_SitesManager_API * * @return int the website ID created */ - public function addSite( $siteName, $urls, $ecommerce = null, $siteSearch = null, $searchKeywordParameters = null, $searchCategoryParameters = null, $excludedIps = null, $excludedQueryParameters = null, $timezone = null, $currency = null, $group = null, $startDate = null ) + public function addSite( $siteName, + $urls, + $ecommerce = null, + $siteSearch = null, + $searchKeywordParameters = null, + $searchCategoryParameters = null, + $excludedIps = null, + $excludedQueryParameters = null, + $timezone = null, + $currency = null, + $group = null, + $startDate = null, + $excludedUserAgents = null ) { Piwik::checkUserIsSuperUser(); @@ -486,7 +500,8 @@ class Piwik_SitesManager_API ); $bind['excluded_ips'] = $this->checkAndReturnExcludedIps($excludedIps); - $bind['excluded_parameters'] = $this->checkAndReturnExcludedQueryParameters($excludedQueryParameters); + $bind['excluded_parameters'] = $this->checkAndReturnCommaSeparatedStringList($excludedQueryParameters); + $bind['excluded_user_agents'] = $this->checkAndReturnCommaSeparatedStringList($excludedUserAgents); $bind['timezone'] = $timezone; $bind['currency'] = $currency; $bind['ecommerce'] = (int)$ecommerce; @@ -745,6 +760,67 @@ class Piwik_SitesManager_API } /** + * Returns the list of user agent substrings to look for when excluding visits for + * all websites. If a visitor's user agent string contains one of these substrings, + * their visits will not be included. + * + * @return string Comma separated list of strings. + */ + public function getExcludedUserAgentsGlobal() + { + Piwik::checkUserHasSomeAdminAccess(); + return Piwik_GetOption(self::OPTION_EXCLUDED_USER_AGENTS_GLOBAL); + } + + /** + * Sets list of user agent substrings to look for when excluding visits. For more info, + * @see getExcludedUserAgentsGlobal. + * + * @param string $excludedUserAgents Comma separated list of strings. Each element is trimmed, + * and empty strings are removed. + */ + public function setGlobalExcludedUserAgents( $excludedUserAgents ) + { + Piwik::checkUserIsSuperUser(); + + // update option + $excludedUserAgents = $this->checkAndReturnCommaSeparatedStringList($excludedUserAgents); + Piwik_SetOption(self::OPTION_EXCLUDED_USER_AGENTS_GLOBAL, $excludedUserAgents); + + // make sure tracker cache will reflect change + Piwik_Common::deleteTrackerCache(); + } + + /** + * Returns true if site-specific user agent exclusion has been enabled. If it hasn't, + * only the global user agent substrings (see @setGlobalExcludedUserAgents) will be used. + * + * @return bool + */ + public function isSiteSpecificUserAgentExcludeEnabled() + { + Piwik::checkUserHasSomeAdminAccess(); + return (bool)Piwik_GetOption(self::OPTION_SITE_SPECIFIC_USER_AGENT_EXCLUDE_ENABLE); + } + + /** + * Sets whether it should be allowed to exclude different user agents for different + * websites. + * + * @param bool $enabled + */ + public function setSiteSpecificUserAgentExcludeEnabled( $enabled ) + { + Piwik::checkUserIsSuperUser(); + + // update option + Piwik_SetOption(self::OPTION_SITE_SPECIFIC_USER_AGENT_EXCLUDE_ENABLE, $enabled); + + // make sure tracker cache will reflect change + Piwik_Common::deleteTrackerCache(); + } + + /** * Sets list of URL query parameters to be excluded on all websites. * Will also apply to websites created in the future. * @@ -754,7 +830,7 @@ class Piwik_SitesManager_API public function setGlobalExcludedQueryParameters($excludedQueryParameters) { Piwik::checkUserIsSuperUser(); - $excludedQueryParameters = $this->checkAndReturnExcludedQueryParameters($excludedQueryParameters); + $excludedQueryParameters = $this->checkAndReturnCommaSeparatedStringList($excludedQueryParameters); Piwik_SetOption(self::OPTION_EXCLUDED_QUERY_PARAMETERS_GLOBAL, $excludedQueryParameters); Piwik_Common::deleteTrackerCache(); return true; @@ -865,7 +941,8 @@ class Piwik_SitesManager_API $timezone = null, $currency = null, $group = null, - $startDate = null) + $startDate = null, + $excludedUserAgents = null) { Piwik::checkUserHasAdminAccess($idSite); @@ -914,7 +991,8 @@ class Piwik_SitesManager_API $bind['ts_created'] = Piwik_Date::factory($startDate)->getDatetime(); } $bind['excluded_ips'] = $this->checkAndReturnExcludedIps($excludedIps); - $bind['excluded_parameters'] = $this->checkAndReturnExcludedQueryParameters($excludedQueryParameters); + $bind['excluded_parameters'] = $this->checkAndReturnCommaSeparatedStringList($excludedQueryParameters); + $bind['excluded_user_agents'] = $this->checkAndReturnCommaSeparatedStringList($excludedUserAgents); $bind['sitesearch'] = $this->checkSiteSearch($siteSearch); list($searchKeywordParameters, $searchCategoryParameters ) = $this->checkSiteSearchParameters($searchKeywordParameters, $searchCategoryParameters); @@ -939,7 +1017,7 @@ class Piwik_SitesManager_API Piwik_PostEvent('SitesManager.updateSite', $idSite); } - private function checkAndReturnExcludedQueryParameters($parameters) + private function checkAndReturnCommaSeparatedStringList($parameters) { $parameters = trim($parameters); if(empty($parameters)) diff --git a/plugins/SitesManager/Controller.php b/plugins/SitesManager/Controller.php index 18bfbb7d1e..54b5995c72 100644 --- a/plugins/SitesManager/Controller.php +++ b/plugins/SitesManager/Controller.php @@ -40,6 +40,7 @@ class Piwik_SitesManager_Controller extends Piwik_Controller_Admin $site['alias_urls'] = Piwik_SitesManager_API::getInstance()->getSiteUrlsFromId($site['idsite']); $site['excluded_ips'] = str_replace(',','<br/>', $site['excluded_ips']); $site['excluded_parameters'] = str_replace(',','<br/>', $site['excluded_parameters']); + $site['excluded_user_agents'] = str_replace(',', '<br/>', $site['excluded_user_agents']); } $view->adminSites = $sites; $view->adminSitesCount = count($sites); @@ -57,10 +58,15 @@ class Piwik_SitesManager_Controller extends Piwik_Controller_Admin $view->globalExcludedIps = str_replace(',',"\n", $excludedIpsGlobal); $excludedQueryParametersGlobal = Piwik_SitesManager_API::getInstance()->getExcludedQueryParametersGlobal(); $view->globalExcludedQueryParameters = str_replace(',',"\n", $excludedQueryParametersGlobal); + + $globalExcludedUserAgents = Piwik_SitesManager_API::getInstance()->getExcludedUserAgentsGlobal(); + $view->globalExcludedUserAgents = str_replace(',', "\n", $globalExcludedUserAgents); $view->globalSearchKeywordParameters = Piwik_SitesManager_API::getInstance()->getSearchKeywordParametersGlobal(); $view->globalSearchCategoryParameters = Piwik_SitesManager_API::getInstance()->getSearchCategoryParametersGlobal(); $view->isSearchCategoryTrackingEnabled = Piwik_PluginsManager::getInstance()->isPluginActivated('CustomVariables'); + $view->allowSiteSpecificUserAgentExclude = + Piwik_SitesManager_API::getInstance()->isSiteSpecificUserAgentExcludeEnabled(); $view->currentIpAddress = Piwik_IP::getIpFromHeader(); @@ -83,14 +89,19 @@ class Piwik_SitesManager_Controller extends Piwik_Controller_Admin $timezone = Piwik_Common::getRequestVar('timezone', false); $excludedIps = Piwik_Common::getRequestVar('excludedIps', false); $excludedQueryParameters = Piwik_Common::getRequestVar('excludedQueryParameters', false); + $excludedUserAgents = Piwik_Common::getRequestVar('excludedUserAgents', false); $currency = Piwik_Common::getRequestVar('currency', false); $searchKeywordParameters = Piwik_Common::getRequestVar('searchKeywordParameters', $default = ""); $searchCategoryParameters = Piwik_Common::getRequestVar('searchCategoryParameters', $default = ""); + $enableSiteUserAgentExclude = Piwik_Common::getRequestVar('enableSiteUserAgentExclude', $default = 0); Piwik_SitesManager_API::getInstance()->setDefaultTimezone($timezone); Piwik_SitesManager_API::getInstance()->setDefaultCurrency($currency); Piwik_SitesManager_API::getInstance()->setGlobalExcludedQueryParameters($excludedQueryParameters); Piwik_SitesManager_API::getInstance()->setGlobalExcludedIps($excludedIps); + Piwik_SitesManager_API::getInstance()->setGlobalExcludedUserAgents($excludedUserAgents); Piwik_SitesManager_API::getInstance()->setGlobalSearchParameters($searchKeywordParameters, $searchCategoryParameters); + Piwik_SitesManager_API::getInstance()->setSiteSpecificUserAgentExcludeEnabled( + $enableSiteUserAgentExclude == 1); $toReturn = $response->getResponse(); } catch(Exception $e ) { $toReturn = $response->getResponseException( $e ); diff --git a/plugins/SitesManager/SitesManager.php b/plugins/SitesManager/SitesManager.php index a05c9a2047..0df2dff87e 100644 --- a/plugins/SitesManager/SitesManager.php +++ b/plugins/SitesManager/SitesManager.php @@ -86,6 +86,7 @@ class Piwik_SitesManager extends Piwik_Plugin $website = Piwik_SitesManager_API::getInstance()->getSiteFromId($idSite); $array['excluded_ips'] = $this->getTrackerExcludedIps($website); $array['excluded_parameters'] = self::getTrackerExcludedQueryParameters($website); + $array['excluded_user_agents'] = self::getExcludedUserAgents($website); $array['sitesearch'] = $website['sitesearch']; $array['sitesearch_keyword_parameters'] = $this->getTrackerSearchKeywordParameters($website); $array['sitesearch_category_parameters'] = $this->getTrackerSearchCategoryParameters($website); @@ -132,6 +133,23 @@ class Piwik_SitesManager extends Piwik_Plugin } return $ipRanges; } + + /** + * Returns the array of excluded user agent substrings for a site. Filters out + * any garbage data & trims each entry. + * + * @param array $website The full set of information for a site. + * @return array + */ + private static function getExcludedUserAgents( $website ) + { + $excludedUserAgents = Piwik_SitesManager_API::getInstance()->getExcludedUserAgentsGlobal(); + if (Piwik_SitesManager_API::getInstance()->isSiteSpecificUserAgentExcludeEnabled()) + { + $excludedUserAgents .= ','.$website['excluded_user_agents']; + } + return self::filterBlankFromCommaSepList($excludedUserAgents); + } /** * Returns the array of URL query parameters to exclude from URLs @@ -144,7 +162,19 @@ class Piwik_SitesManager extends Piwik_Plugin $globalExcludedQueryParameters = Piwik_SitesManager_API::getInstance()->getExcludedQueryParametersGlobal(); $excludedQueryParameters .= ',' . $globalExcludedQueryParameters; - $parameters = explode(',', $excludedQueryParameters); + return self::filterBlankFromCommaSepList($excludedQueryParameters); + } + + /** + * Trims each element of a comma-separated list of strings, removes empty elements and + * returns the result (as an array). + * + * @param string $parameters The unfiltered list. + * @return array The filtered list of strings as an array. + */ + private function filterBlankFromCommaSepList( $parameters ) + { + $parameters = explode(',', $parameters); $parameters = array_filter($parameters, 'strlen'); $parameters = array_unique($parameters); return $parameters; diff --git a/plugins/SitesManager/templates/SitesManager.js b/plugins/SitesManager/templates/SitesManager.js index 391c990528..f2473689ce 100644 --- a/plugins/SitesManager/templates/SitesManager.js +++ b/plugins/SitesManager/templates/SitesManager.js @@ -44,8 +44,10 @@ function SitesManager ( _timezones, _currencies, _defaultTimezone, _defaultCurre var timezone = encodeURIComponent($(row).find('#timezones option:selected').val()); var currency = encodeURIComponent($(row).find('#currencies option:selected').val()); var excludedQueryParameters = $(row).find('textarea#excludedQueryParameters').val(); - var ecommerce = encodeURIComponent($(row).find('#ecommerce option:selected').val()); excludedQueryParameters = piwikHelper.getApiFormatTextarea(excludedQueryParameters); + var excludedUserAgents = $(row).find('textarea#excludedUserAgents').val(); + excludedUserAgents = piwikHelper.getApiFormatTextarea(excludedUserAgents); + var ecommerce = encodeURIComponent($(row).find('#ecommerce option:selected').val()); var sitesearch = encodeURIComponent($(row).find('#sitesearch option:selected').val()); var searchKeywordParameters = $('input#searchKeywordParameters').val(); var searchCategoryParameters = $('input#searchCategoryParameters').val(); @@ -61,6 +63,7 @@ function SitesManager ( _timezones, _currencies, _defaultTimezone, _defaultCurre request += '&ecommerce='+ecommerce; request += '&excludedIps='+excludedIps; request += '&excludedQueryParameters='+excludedQueryParameters; + request += '&excludedUserAgents='+excludedUserAgents; request += '&siteSearch='+sitesearch; request += '&searchKeywordParameters='+searchKeywordParameters; request += '&searchCategoryParameters='+searchCategoryParameters; @@ -94,6 +97,8 @@ function SitesManager ( _timezones, _currencies, _defaultTimezone, _defaultCurre excludedIps = piwikHelper.getApiFormatTextarea(excludedIps); var excludedQueryParameters = $(row).find('textarea#excludedQueryParameters').val(); excludedQueryParameters = piwikHelper.getApiFormatTextarea(excludedQueryParameters); + var excludedUserAgents = $(row).find('textarea#excludedUserAgents').val(); + excludedUserAgents = piwikHelper.getApiFormatTextarea(excludedUserAgents); var timezone = encodeURIComponent($(row).find('#timezones option:selected').val()); var currency = encodeURIComponent($(row).find('#currencies option:selected').val()); var ecommerce = encodeURIComponent($(row).find('#ecommerce option:selected').val()); @@ -112,6 +117,7 @@ function SitesManager ( _timezones, _currencies, _defaultTimezone, _defaultCurre request += '&ecommerce='+ecommerce; request += '&excludedIps='+excludedIps; request += '&excludedQueryParameters='+excludedQueryParameters; + request += '&excludedUserAgents='+excludedUserAgents; request += '&siteSearch='+sitesearch; request += '&searchKeywordParameters='+searchKeywordParameters; request += '&searchCategoryParameters='+searchCategoryParameters; @@ -132,8 +138,11 @@ function SitesManager ( _timezones, _currencies, _defaultTimezone, _defaultCurre excludedIps = piwikHelper.getApiFormatTextarea(excludedIps); var excludedQueryParameters = $('textarea#globalExcludedQueryParameters').val(); excludedQueryParameters = piwikHelper.getApiFormatTextarea(excludedQueryParameters); + var globalExcludedUserAgents = $('textarea#globalExcludedUserAgents').val(); + globalExcludedUserAgents = piwikHelper.getApiFormatTextarea(globalExcludedUserAgents); var searchKeywordParameters = $('input#globalSearchKeywordParameters').val(); var searchCategoryParameters = $('input#globalSearchCategoryParameters').val(); + var enableSiteUserAgentExclude = $('input#enableSiteUserAgentExclude').is(':checked') ? 1 : 0; var request = ''; request += 'module=SitesManager'; request += '&action=setGlobalSettings'; @@ -142,6 +151,8 @@ function SitesManager ( _timezones, _currencies, _defaultTimezone, _defaultCurre request += '¤cy='+currency; request += '&excludedIps='+excludedIps; request += '&excludedQueryParameters='+excludedQueryParameters; + request += '&excludedUserAgents='+globalExcludedUserAgents; + request += '&enableSiteUserAgentExclude='+enableSiteUserAgentExclude; request += '&searchKeywordParameters='+searchKeywordParameters; request += '&searchCategoryParameters='+searchCategoryParameters; request += '&token_auth=' + piwik.token_auth; @@ -163,6 +174,7 @@ function SitesManager ( _timezones, _currencies, _defaultTimezone, _defaultCurre <td><textarea cols="25" rows="3" id="urls">http://siteUrl.com/\nhttp://siteUrl2.com/</textarea><br />'+aliasUrlsHelp+'</td>\ <td><textarea cols="20" rows="4" id="excludedIps"></textarea><br />'+excludedIpHelp+'</td>\ <td><textarea cols="20" rows="4" id="excludedQueryParameters"></textarea><br />'+excludedQueryParametersHelp+'</td>\ + <td><textarea cols="20" rows="4" id="excludedUserAgents"></textarea><br />'+excludedUserAgentsHelp+'</td>\ <td>'+getSitesearchSelector(false)+'</td>\ <td>'+getTimezoneSelector(defaultTimezone)+'<br />' + timezoneHelp + '</td>\ <td>'+getCurrencySelector(defaultCurrency)+'<br />' + currencyHelp + '</td>\ @@ -256,6 +268,12 @@ function SitesManager ( _timezones, _currencies, _defaultTimezone, _defaultCurre contentAfter += '<br />'+excludedQueryParametersHelp; $(n).html(contentAfter); } + else if (idName == 'excludedUserAgents') + { + var contentAfter = '<textarea cols="20" rows="4" id="excludedUserAgents">' + + contentBefore.replace(/<br *\/? *>/gi,"\n")+'</textarea><br />'+excludedUserAgentsHelp; + $(n).html(contentAfter); + } else if(idName == 'timezone') { var contentAfter = getTimezoneSelector(contentBefore); @@ -434,3 +452,4 @@ function onClickSiteSearchUseDefault() $('#sitesearchIntro').show(); } } + diff --git a/plugins/SitesManager/templates/SitesManager.tpl b/plugins/SitesManager/templates/SitesManager.tpl index d16539fe7d..0a172540b7 100644 --- a/plugins/SitesManager/templates/SitesManager.tpl +++ b/plugins/SitesManager/templates/SitesManager.tpl @@ -37,7 +37,15 @@ var aliasUrlsHelp = '{'SitesManager_AliasUrlHelp'|translate|inlineHelp|escape:ja {'SitesManager_PiwikWillAutomaticallyExcludeCommonSessionParameters'|translate:"phpsessid, sessionid, ..."} {/capture} {assign var=excludedQueryParametersHelp value=$excludedQueryParametersHelp|inlineHelp} + +{capture assign=excludedUserAgentsHelp} + {'SitesManager_GlobalExcludedUserAgentHelp1'|translate} + <br/><br/> + {'SitesManager_GlobalListExcludedUserAgents_Desc'|translate} {'SitesManager_GlobalExcludedUserAgentHelp2'|translate} +{/capture} +{assign var=excludedUserAgentsHelp value=$excludedUserAgentsHelp|inlineHelp} var excludedQueryParametersHelp = '{$excludedQueryParametersHelp|escape:javascript}'; +var excludedUserAgentsHelp = '{$excludedUserAgentsHelp|escape:javascript}'; var timezoneHelp = '{$timezoneHelpPlain|inlineHelp|escape:javascript}'; var currencyHelp = '{$currencyHelpPlain|escape:javascript}'; var ecommerceHelp = '{$ecommerceHelpPlain|inlineHelp|escape:javascript}'; @@ -140,6 +148,7 @@ vertical-align:middle; <th>{'SitesManager_Urls'|translate}</th> <th>{'SitesManager_ExcludedIps'|translate}</th> <th>{'SitesManager_ExcludedParameters'|translate|replace:" ":"<br />"}</th> + <th id='exclude-user-agent-header' {if !$allowSiteSpecificUserAgentExclude}style="display:none"{/if}>{'SitesManager_ExcludedUserAgents'|translate}</th> <th>{'Actions_SubmenuSitesearch'|translate}</th> <th>{'SitesManager_Timezone'|translate}</th> <th>{'SitesManager_Currency'|translate}</th> @@ -156,13 +165,14 @@ vertical-align:middle; <td id="siteName" class="editableSite">{$site.name}</td> <td id="urls" class="editableSite">{foreach from=$site.alias_urls item=url}{$url|replace:"http://":""}<br />{/foreach}</td> <td id="excludedIps" class="editableSite">{foreach from=$site.excluded_ips item=ip}{$ip}<br />{/foreach}</td> - <td id="excludedQueryParameters" class="editableSite">{foreach from=$site.excluded_parameters item=parameter}{$parameter}<br />{/foreach}</td> + <td id="excludedQueryParameters" class="editableSite">{foreach from=$site.excluded_parameters item=parameter}{$parameter}<br />{/foreach}</td> + <td id="excludedUserAgents" class="editableSite" {if !$allowSiteSpecificUserAgentExclude}style="display:none"{/if}>{foreach from=$site.excluded_user_agents item=ua}{$ua}<br />{/foreach}</td> <td id="sitesearch" class="editableSite">{if $site.sitesearch}<span class='sitesearchActive'>{'General_Yes'|translate}</span>{else}<span class='sitesearchInactive'>-</span>{/if}<span class='sskp' sitesearch_keyword_parameters="{$site.sitesearch_keyword_parameters|escape:'html'}" sitesearch_category_parameters="{$site.sitesearch_category_parameters|escape:'html'}" id="sitesearch_parameters"></span></td> <td id="timezone" class="editableSite">{$site.timezone}</td> <td id="currency" class="editableSite">{$site.currency}</td> <td id="ecommerce" class="editableSite">{if $site.ecommerce}<span class='ecommerceActive'>{'General_Yes'|translate}</span>{else}<span class='ecommerceInactive'>-</span>{/if}</td> - <td><span id="row{$i}" class='editSite link_but'><img src='themes/default/images/ico_edit.png' title="{'General_Edit'|translate}" border="0"/> {'General_Edit'|translate}</span></td> - <td><span id="row{$i}" class="deleteSite link_but"><img src='themes/default/images/ico_delete.png' title="{'General_Delete'|translate}" border="0" /> {'General_Delete'|translate}</span></td> + <td><span id="row{$site.idsite}" class='editSite link_but'><img src='themes/default/images/ico_edit.png' title="{'General_Edit'|translate}" border="0"/> {'General_Edit'|translate}</span></td> + <td><span id="row{$site.idsite}" class="deleteSite link_but"><img src='themes/default/images/ico_delete.png' title="{'General_Delete'|translate}" border="0" /> {'General_Delete'|translate}</span></td> <td><a href='{url action=displayJavascriptCode idSite=$site.idsite updated=false}'>{'SitesManager_ShowTrackingTag'|translate}</a></td> </tr> {/foreach} @@ -209,6 +219,23 @@ vertical-align:middle; </textarea> </td><td><label for="globalExcludedQueryParameters">{$excludedQueryParametersHelp}</label> </td></tr> + + {* global excluded user agents *} + <tr><td colspan="2"> + <b>{'SitesManager_GlobalListExcludedUserAgents'|translate}</b> + <p>{'SitesManager_GlobalListExcludedUserAgents_Desc'|translate}</p> + </td></tr> + + <tr><td> + <textarea cols="30" rows="3" id="globalExcludedUserAgents">{$globalExcludedUserAgents}</textarea> + </td><td><label for="globalExcludedUserAgents">{$excludedUserAgentsHelp}</label> + </td></tr> + + <tr><td> + <input type="checkbox" id="enableSiteUserAgentExclude" name="enableSiteUserAgentExclude" {if $allowSiteSpecificUserAgentExclude}checked="checked"{/if}/><label for="enableSiteUserAgentExclude">{'SitesManager_EnableSiteSpecificUserAgentExclude'|translate}</label> + <span id='enableSiteUserAgentExclude-loading' class='loadingPiwik' style='display:none'><img src='./themes/default/images/loading-blue.gif' /></span> + </td><td>{'SitesManager_EnableSiteSpecificUserAgentExclude_Help'|translate:'<a href="#editSites">':'</a>'|inlineHelp} + </td></tr> <tr><td colspan="2"> <a name='globalSiteSearch'></a><b>{'SitesManager_TrackingSiteSearch'|translate}</b> |