Track pageviews in Google Analytics on partial url of Grails application

Posted by Pieter van Gent on Stack Overflow See other posts from Stack Overflow or by Pieter van Gent
Published on 2011-11-20T15:41:57Z Indexed on 2011/11/20 17:52 UTC
Read the original article Hit count: 304

Filed under:
|

For my Grails application I want to set up Google Analytics to track only "partial" url's. I 'll explain:

  • a typical Grails url consists of the following parts: domain + application-name + controller + action + id
  • e.g. www.mydomain.com/myapp/controller/action/12345

As far as I understand for Google Analytics the page to be tracked is identified by the entire url. For my purpose I'm not interested in the id part of the url: I want to know which actions have been performed, but I need not know for which id the action was executed.

And of course I would like a generic solution, because I have multiple controllers and multiple actions... Maybe some kind of filter stating "I want to track pages 3 levels deep (/myapp/controller/action)" would do? Or a filter stating "exclude everything from url after the last /"?

Any help would be much appreciated.

Kind regards, Pieter

© Stack Overflow or respective owner

Related posts about grails

Related posts about google-analytics