Hi Mariana,
Yes, with __trackPageview you can pretty much achieve what you want to do.
In your menu component you probably change the panels by instantiating and
replacing a main panel inside your page, right?
If yes, do something like this:
public void onClick(AjaxRequestTarget target) {
// ... replace, etc
target.appendJavaScript("pageTracker._trackPageview('" + panel trackCode +
"');");
}
AjaxRequestTarget.appendJavaScript gets evaluated by the browser at the end
of the AJAX call.
Hope this helps,
Janos
On Fri, Apr 17, 2009 at 11:53 PM, Mariana Bustamante <[email protected]>wrote:
> Hello,
>
> I'm trying to use Google Analytics with my web application made using
> Wicket. The layout of my application is like this:
>
> I have a global plage called "homePage" that contains some panels inside.
> One of the panels is a menu which is completely made in java code using
> Wicket, the other important panel is the content panel that changes to a
> different panel with Ajax every time a user clicks a button on the menu.
>
> I tried placing the Google Analytics script at the bottom of the homePage
> but, as expected, in the generated report I can only see this page.
> However,
> I need to be able to view every panel as a different page.
>
> There is a link in the google analytics suppport page that seems like what
> I'm looking for (
>
> http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&answer=55519
> )
> but I can't see where to put the code they give since the links in my menu
> are generated by Wicket in java code and not in html.
>
> I would really appreciate any help to solve this problem,
>
> Thanks in advance,
>
> Mariana
>