Sending searches through Header Live Search to Google Analytics

Posted in: Newspaper
Post count: 3

Hi!

I’m trying to send events to Google Analytics whenever a search is performed through the Header Live Search. In particular I’m interested in what users are searching for.

I am able to capture the submit event when the user clicks ‘Search’ and I am able to capture a click event when the user selects one of the choices that appear when they’ve searched for a term but I cannot find a way to capture any event when enter is pressed in the input field. As far as I can tell no event is being fired (not submit, not keyup, not keypress, etc.).

I’m looking for advice on handling this particular case. I am also interested in whether this is the best approach to tracking searches or whether there is a standardized way of tracking these searches that is supported ?

Take care,

Billy

Post count: 3

I should note that I am using Google Tag Manager + Firebase.

Take care,

Billy

Post count: 3

I managed to resolve the issue by using onsubmit instead of addEventListener.

I am still interested in hearing if there is a better approach then listening for submit events, though.

Take care,

Billy

Post count: 35449

Hi,

Yes, this is a good approach, unfortunately our theme do not has a tracker for Header Live Search, this need to be implement manually or using some extra plugins.

Thank you!

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newspaper’ is closed to new topics and replies.