Skip Navigation

[Resolved] Tracking search parameters by Google Analytics

This support ticket is created 5 years, 7 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 5 replies, has 2 voices.

Last updated by Luo Yang 5 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1115715

Hi,

we´ve implemented a custom search at a view. Is it possible somehow to track the selected search parameters by Google Analytics?

I´ve found these threads, but I wonder, if I can use the ajax method?
https://toolset.com/forums/topic/track-ajax-custom-search-with-google-analytics/
or is it not possible by now:
https://toolset.com/forums/topic/tracking-of-toolset-views-search-in-google-analytics/

Regards,

#1116195

Hello,

How do you want the Google Analytics to track the search parameters?

if you have installed Google Analytics into your website, it should be able to record all URLs visited by user, for example:
hidden link

The parameter is tracked in the URL.

#1116203

Hi,

I would like to track the search parameter as event type. For some url clicks I could set this, but I don´t know, how I can set it for a form on the single fields (selects / radio buttons), which can trigger an event at GA. So I could see, what search parameter are used how often.

Regards,

#1116309

There isn't such kind of feature within Views plugin, it needs custom codes, which is out the range of Toolset support.

You might also consider other workarounds, for example:
hidden link

#1116313

Thanks. How can I insert the given search parameters from my view search to this link, which is executed and how can I add the google campaign url to the submit button. Is there any onclick event (js) what I can use?

I´ve tried the following, but it doesn´t seem to be right:

jQuery(document).ready(function(){
jQuery('form.wpv-filter-form').submit(function(e){
return this.href + '?utm_source=partnersuche';
});
});

#1116995

According to google document:
hidden link
Google Analytics can track some specific URL parameter names, for example, in URL:
hidden link
Google Analytics can track those:
- utm_source
- utm_medium
...
you need to edit your view, in section "Search and Pagination" pass the same URL parameter name as above.

But it is only a workaround, for your reference.

For other question:
Is there any onclick event (js) what I can use?

There isn't such built-in feature within Toolset or existed solutions, as I mentioned above, it needs custom codes, you might consider our "Toolset Contractors":
https://toolset.com/contractors/

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.