Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Seems to be possible
Comment | File | Size | Author |
---|---|---|---|
#3 | google_analytics-alter-search-page-934076.patch | 296.56 KB | rogierbom |
Comments
Comment #1
hass CreditAttribution: hass commentedMarked #1694622: Search API Pages integration as duplicate.
Comment #2
malc0mn CreditAttribution: malc0mn commentedAFAIK, 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?
Comment #3
rogierbom CreditAttribution: rogierbom commentedWe 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.
Comment #4
rogierbom CreditAttribution: rogierbom commentedComment #6
hass CreditAttribution: hass commentedComment #7
miiimoooThis 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.
Comment #8
rooby CreditAttribution: rooby commentedThis 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.
Comment #9
Darren OhComment #10
japerryWith 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.