The example says it's onclick="flowsplitreward", but the only JavaScript method available is called flowsplit_reward(...).
Even when using flowsplit_reward(...), the Ajax call doesn't seem to be made when the link href attribute is not "#". So every real-world link click won't be tracked.
In my tests only presentations are tracked, which sadly makes the plugin half-useless to me.
I suggest the following:
- use
data-flowsplit="reward" or something similar on the links instead of specifying the onclick attribute
- provide a jQuery spy on
$('a[data-flowsplit="reward"]').on('click', ...) which will ...
event.preventDefault() to stop leaving the page
- fire the Ajax call
- visit the original link target in the Ajax callback functions
The example says it's
onclick="flowsplitreward", but the only JavaScript method available is calledflowsplit_reward(...).Even when using
flowsplit_reward(...), the Ajax call doesn't seem to be made when the linkhrefattribute is not "#". So every real-world link click won't be tracked.In my tests only presentations are tracked, which sadly makes the plugin half-useless to me.
I suggest the following:
data-flowsplit="reward"or something similar on the links instead of specifying theonclickattribute$('a[data-flowsplit="reward"]').on('click', ...)which will ...event.preventDefault()to stop leaving the page