-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Any suggestions for how best to integrate a ZK MVVM web UI with Google Analytics?
Hi Davout!
Depends what you are planning to track. If you just want the plain old page count, just add the GA initialization code (from GA console) globally in your application, and add a ga('send', 'pageview') call in the same script. Global JS code can be deployed from zk.xml or from lang-addon.xml (I would recommend lang-addon as it's easier to declare a js file located somewhere in your project)
If you want to do more complicated stuff (like sending events on specific actions), there is no "one-size-fits-all" solution. The approach will depend on the action and timing. Edit: in any case, global init from lang-addon will still be a good start, since you will need the GA object initialized on client side when you are ready to send anything.
I've found that GA has a Java client library that can be used to post events. My intention is to add a call to GA as the final step in each MVVM class event handler method. Sound right?
Asked: 2018-06-29 05:07:57 +0800
Seen: 13 times
Last updated: Jul 02 '18
How to control selectAll() feature in a Listbox with multiple=true and checkmark=true
ZK8 Wizard Series: Part 2 now released!
Faster And Lighter, The Performance Test On ZK8
org.zkoss.xel.XelException: Resource not found: http://www.zkoss.org/dsp/web/core
How To Check Dirty Status in ZK8?
Come and join the ''JS'' Hunt!