[Piwik-hackers] piwik tracking on ajax requests?

Echo Chargen echochargen at gmail.com
Fri Jul 4 01:06:04 CEST 2008


Update.  The behavior is only seen when I try to set the
piwik_action_name variable.  If this variable is the default like:
piwik_action_name = '';
...it works fine with the ajax request I describe.

On Thu, Jul 3, 2008 at 4:48 PM, Echo Chargen <echochargen at gmail.com> wrote:
> Hello -
> Piwik is great.  I love the api.
> I'm trying to use piwik to track ajax requests on my site.  I use the
> Prototype javascript library to handle the ajax requests with the
> Ajax.updater functionality (updates a div on the page).  If I include
> the piwik tracking code in the html returned by the ajax request, the
> response spills out of the div I'm trying to update and I end up with
> a white page with the img src of the piwik.php request in the source
> like:
>
> <img src="http://stats.oneclickteam.com/piwik/piwik.php?url=http%3A%2F%2Fwww.talkaboutfree.com%2Fjer&action_name=Lead%20Form%20Show&idsite=18&res=1280x1024&col=32&h=16&m=45&s=12&fla=1&dir=0&qt=1&realp=0&pdf=1&wma=1&java=1&cookie=1&title=talkaboutfree.com&urlref="
> alt="Piwik" style="border:0" />
>
> The same happens when I call the piwik_log() function directly from
> the javascript I'm using to call the Ajax.updater request.
> What's interesting is that both ways result in the stats being updated
> for the action as desired, but the request response just gets messed
> up.
>
> I realize this is probably prototype.js related, but can anyone
> comment on how they are using piwik tracking on ajax requests?
> Perhaps in conjunction with jquery or other javascript framework
> libraries?
>
> Thanks for any response,
> Jeremy
>


More information about the Piwik-hackers mailing list