When I add a function to _paq that is supposed to set custom variables, I cannot read the variables first. Due to the fact that the siteId is pushed to _paq it is not set for any function that I added beforehand. Solution would be to unshift the setSiteId call instead of pushing it into the array:

$script .= '_paq.unshift(["setSiteId", ' . drupal_to_js(variable_get('piwik_site_id', '')) . ']);';

This way, the siteId is available when getCustomVariablesFromCookie() or getCookieName() is called.

Comments

hass’s picture

Category: bug » support
Status: Active » Closed (cannot reproduce)
hass’s picture

Issue summary: View changes

adding code tags