With Piwik 0.4 (will be released soon) piwik introduces a new tracking api. i created a patch to use this new api.

regards

Comments

pebosi’s picture

StatusFileSize
new2.16 KB
hass’s picture

Looks like a stolen API from GA... :-)

hass’s picture

Category: feature » task
Status: Active » Needs work

drupal_to_js adds double quotes automatically: ("'. drupal_to_js($trackfiles_extensions) .'"). And + $script .= 'piwikTracker.setCustomVars({ '. implode(', ', $piwik_vars_fields) .' });'; looks code wise wrong, too. Do not forget that $piwik_vars_fields could be empty...

pebosi’s picture

StatusFileSize
new2.23 KB

im sure, piwik developers got some suggestions from other tracking api's, why not?

updated my patch.

regards

hass’s picture

Status: Needs work » Needs review

I keep this open until the 0.4 you referenced becomes available. Than create a new release for Piwik 0.4 very soon.

hass’s picture

Title: Piwik's new JS Tracking API » Upgrade to new Piwik v0.4 JS Tracking API
hass’s picture

Is this a fake? Where can I find the info about this 0.4 version? The latest version from SVN still have the old code style... ???

hass’s picture

Ah... found it. Do you know if there is a reason why enableLinkTracking() comes after trackPageView()? If this is a requirement than the patch still needs work.

</script><script type="text/javascript">
try {
  var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", {$idSite});
  piwikTracker.trackPageView();
  piwikTracker.enableLinkTracking();
} catch( err ) {}
</script>
pebosi’s picture

the order is equal.

regards

hass’s picture

Status: Needs review » Needs work

Great, thank you very much for the links! This patch needs some work... there are many new features I waited for a long time... we could add some more features - GA already have and I was made to remove in piwik... Internal site search tracking may be possible, too. We need to investigate more on this.

pebosi’s picture

Status: Needs work » Needs review

my patch should only move the basic tracking to the new api. new features will be in another patch, or did you just started to work on it? ;)

regards

hass’s picture

Ok, but enableLinkTracking() need to come after pagetracker if I reed the dogs correctly. Isn't it?

pebosi’s picture

StatusFileSize
new2.32 KB

after asking matthew from piwik about the order, i changed my patch as you suggested.

regards

hass’s picture

Have matt explained you something about the order? If required - why? My idea is the binding to all elements may takes time and shouldn't block the page tracking process. Therefore it is done as the very last step.

Have you tested your code??? if (!($track_outgoing = variable_get('piwik_track', 1))) { looks wrong to me. enableLinkTracking() sounds like - link tracking is not enabled by default...

pebosi’s picture

the reason is to give priority to the tracking of the current page, and then installing the tracker on all links; it's pretty much similar really

regards

hass’s picture

Status: Needs review » Needs work
hass’s picture

Status: Needs work » Fixed

I've committed the patch with a few changes and a bugfix for #15 to D5 and D6

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.