Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6887037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:50:07+00:00 2026-05-27T05:50:07+00:00

For my Grails application I want to set up Google Analytics to track only

  • 0

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. http://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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:50:08+00:00Added an answer on May 27, 2026 at 5:50 am

    I think this question is best answered by this article.

    As the other contributors suggested, I too thought the issue should be resolved in Google Analytics. I clicked around a bit and got hopelessly confused.

    Solving the issue within Grails is much much easier. In short the answer is:

    • in the Google Analytics tracking javascript there is a
      “_trackpageview” action
    • this action can take as parameter the url you want to track
    • in Grails I can simply add the stuff I want to track:
      application/controller/action
    • my Google Analytics script is in my main template
    • I just use: _gaq.push([‘_trackPageview’,’myapp/${controllerName}/${actionName}’]);
    • (“myapp” should be the name of your application)
    • (${controllerName} and ${actionName} are generically available
      variables in the Grails views)

    Hope this will help others.

    Thnx for the other answers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create web application using Grails. The main layout consists of few
In my grails application I want to read some values from properties file and
I want to use a service in my Grails application. However, it is always
I have some text area field in my grails application. I got the following
Hi am developing my first grails application now i want to put search method
In my grails application, I want to display all the current entries of the
I am developing grails application which uses file searching.For that I wrote the following
I want to run a periodic task within a Grails application. Can anyone recommend
I've set up several packages in my grails application to log to certain files
I am creating one web application in GRAILS framework.In that I want to implement

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.