Skip to content

Commit

Permalink
#4228 track searches with no result and track num of results
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandru-m-g committed Jun 20, 2016
1 parent 3c2b3cc commit cde5aa7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@ $(function setUpSearchTracking() {
}
};

var numberOfResults = parseInt($('#analytics-number-of-results').text().trim()) || 0;

var paramList = formEl.serializeArray();
var mixpanelEventMeta = {
"page title": analyticsInfo.pageTitle
"page title": analyticsInfo.pageTitle,
"number of results": numberOfResults
/*"org name": analyticsInfo.organizationName,
"org id": analyticsInfo.organizationId,
"group names": analyticsInfo.groupNames,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

{% set min_version = full_facet_info.get("filters_selected") or full_facet_info.get("query_selected") %}
{% set searchValue = request.params.get('q') if request.params.get('q') else '' %}

<div style="display: none;" id="analytics-number-of-results">{{c.page.item_count}}</div>

{% if packages %}
<form id="dataset-filter-form" style="display: inline;">
<div id="base-filter-location" style="display: none;">{{other_links.get('current_page_url')}}</div>
Expand Down Expand Up @@ -154,6 +157,9 @@
{% else %}
<div class="list-items search-form">
{% set src_msg = 'for \"'+ searchValue +'\"' if searchValue else '' %}
<form id="dataset-filter-form" style="display: none;">
<input name="q" type="hidden" value="{{searchValue}}">
</form>
<h2>Sorry no datasets found {{src_msg}}</h2>
</div>
{% endif %}
Expand Down

0 comments on commit cde5aa7

Please sign in to comment.