Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
drupal.org
google_analytics
Commits
29af6b1c
Commit
29af6b1c
authored
Nov 10, 2012
by
hass
Browse files
Optimized documenation for SiteSearch
parent
06b6f61e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
googleanalytics.module
googleanalytics.module
+2
-0
No files found.
googleanalytics.module
View file @
29af6b1c
...
...
@@ -149,6 +149,8 @@ function googleanalytics_page_alter(&$page) {
// Site search tracking support.
$url_custom
=
''
;
if
(
module_exists
(
'search'
)
&&
variable_get
(
'googleanalytics_site_search'
,
FALSE
)
&&
arg
(
0
)
==
'search'
&&
$keys
=
googleanalytics_search_get_keys
())
{
// hook_preprocess_search_results() is not executed if search result is
// empty. Make sure the counter is set to 0 if there are no results.
$url_custom
=
'(window.googleanalytics_search_results) ? '
.
drupal_json_encode
(
url
(
'search/'
.
arg
(
1
),
array
(
'query'
=>
array
(
'search'
=>
$keys
))))
.
' : '
.
drupal_json_encode
(
url
(
'search/'
.
arg
(
1
),
array
(
'query'
=>
array
(
'search'
=>
'no-results:'
.
$keys
,
'cat'
=>
'no-results'
))));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment