Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ed677d7a authored by smain@google.com's avatar smain@google.com
Browse files

update analytics event for searches to make query case-insensitive

and save the URL instead of doc title.

Change-Id: Iad8c5f4873173f6964fc4ebffee8aef878891a8e
parent 0ecb5a68
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -1728,8 +1728,8 @@ var gDocsListLength = 0;

function onSuggestionClick(link) {
  // When user clicks a suggested document, track it
  ga('send', 'event', 'Suggestion Click', 'clicked: ' + $(link).text(),
            'from: ' + $("#search_autocomplete").val());
  ga('send', 'event', 'Suggestion Click', 'clicked: ' + $(link).attr('href'),
                'query: ' + $("#search_autocomplete").val().toLowerCase());
}

function set_item_selected($li, selected)
@@ -2702,8 +2702,8 @@ function addResultClickListeners() {
  $("#searchResults a.gs-title").each(function(index, link) {
    // When user clicks enter for Google search results, track it
    $(link).click(function() {
      ga('send', 'event', 'Google Click', 'clicked: ' + $(this).text(),
                'from: ' + $("#search_autocomplete").val());
      ga('send', 'event', 'Google Click', 'clicked: ' + $(this).attr('href'),
                'query: ' + $("#search_autocomplete").val().toLowerCase());
    });
  });
}