Analytics
3.1K members online now
Understand information in your reports and troubleshoot reporting issues such as self-referrals, (not set) data, and inaccurate information
 
Guide Me
star_border
Reply

Site search category is always 'not set''

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Dear community

 

I have a page with internal search and I'm trying to know which filters do users click to search in it. The structure of the URL with a search and a filter is the following:

 

/search/apachesolr_search/?filters=sm_facetbuilder_facet_node_type%3A"facet_node_type%3Afacet_1"

 

In order to detect the internal search, I have activated the Site search tracking with "search" and "search/apachesolr_search/" as query parameters. I have activated also the Site search categories with "?filters=" as a Category parameter, but theonly information I can obtain in the Site search category is "Not set"

 

Thank you all very much for your helpGA internal search

 

 

 

1 Expert replyverified_user

Re: Site search category is always 'not set''

Top Contributor
# 2
Top Contributor
Hi, in your example you don't seem to be capturing a keyword, in which case no category will be assigned to it.
VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

Re: Site search category is always 'not set''

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Hi Julien,

Thank you very much for your reply. I do not understand, where should I capture the keyword? In the previous example I was just filtering without seaching any particular concept. Please find below another example of normal search, and search with filters:

Normal search of the word "trial": /search/apachesolr_search/trial
Search the word "trial" filtering by "event": /search/apachesolr_search/trial?filters=sm_facetbuilder_facet_node_type%3A"facet_node_type%3Afacet_7"
Search the word "trial" filtering by "event" and "2014": /search/apachesolr_search/trial?filters=sm_facetbuilder_facet_node_type%3A%22facet_node_type%3Afacet_7%22%20created%3A%5B2014-01-01T00%3A00%3A00Z%20TO%202017-01-01T00%3A00%3A00Z%5D

In any of those cases, the information I get in Site search category is (not set)

Re: Site search category is always 'not set''

Top Contributor
# 4
Top Contributor

Like I said, there is no search parameter so as a result, there is no search category.

Your url would need to look like so:
/search/apachesolr_search/?searchterm=trial&searchcategory=event

 

Of course, make sure that searchterm and searchcategory are defined in your view's list of onsite search keyword and category parameters (respectively)

VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

Re: Site search category is always 'not set''

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭
Ok, I understand it now Smiley Happy

The problem is that the page is based on Drupal, so the URL has that structure and I can not change it.

I have defined as searchterm the "/search/apachesolr_search" and as searchcategory "?filters=". With this information, I get results for the internal searches but not for the categories.

Re: Site search category is always 'not set''

Top Contributor
# 6
Top Contributor
You're faced with a classic Drupal issue.
Are you using regular GA tagging or Google Tag Manager?
VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

Re: Site search category is always 'not set''

Visitor ✭ ✭ ✭
# 7
Visitor ✭ ✭ ✭
I am using regular GA tagging

Re: Site search category is always 'not set''

Top Contributor
# 8
Top Contributor

OK so you'll have te find a way with Drupal to rewrite your pageview call.

 

Assuming you have a search keyword and category, pass them to the Drupal config object on the search result page.

Then, with protocode similar to the following, 

 

// determine if search term is store in Drupal conf object or use the default GA URL
var _gaPage = Drupal.gaSearchTerm != undefined ? document.location.pathname : "/search/?term="+Drupal.gaSearchTerm;

// Rewrite the GA pageview call
ga('send','pageview',_gaPage);

I'm sure you can figure out how to expand this to include categories ;-)

VP & Chief Evangelist at Hub'Scan | Contact me
Level 80 Digital Analytics Warrior, KPI Therapist and Keeper of the One True Tagging Plan

Re: Site search category is always 'not set''

Visitor ✭ ✭ ✭
# 9
Visitor ✭ ✭ ✭
Thank you! I will try it and see if I can fix it