Seems to be possible

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

hass’s picture

malc0mn’s picture

AFAIK, this is not used by Search API so that won't cut it for that module... The patch in #1694622: Search API Pages integration seems the right aproach for search api but I'm wondering where it should go. In this module, or as a form_alter etc. in the search_api_pages module...?

Making Google Analytics support all and every module out there seems silly, so why just not do it the other way around?

rogierbom’s picture

We had the need to add Apache Solr search pages to the Google Analytics so they will show up in the internal site search results. The supplied patch provides an alter hook so that other modules can alter the search page url and keywords. The example in google_analytics.api.php shows how we inplemented it for the apachesolr module.

rogierbom’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 3: google_analytics-alter-search-page-934076.patch, failed testing.

hass’s picture

Version: 7.x-1.x-dev » 8.x-2.x-dev
miiimooo’s picture

This patch is a great approach. I've managed to use the same approach for 7.x-1.3 . The only issue I have with it is it still assumes the search query string is "search". In other words you have to change your views fulltext search string to "search". Otherwise what it sends to GA will be incorrect.

rooby’s picture

This patch has a large amount of changes that are unrelated to the topic of this issue, which makes it hard to review.
When a re-roll is done they should be removed.

Actually considering that and the age of the patch it's probably easier to start from scratch.

Darren Oh’s picture

Issue tags: +fldc19
japerry’s picture

Status: Needs work » Closed (outdated)

With the sunset of legacy google analytics, the 8.x-2.x module is now unsupported. If this is still an issue with the 4.x version, please file a new issue in the queue.