I am responding to your entry, because I am surprised that the phrase this.getVisitorId() returns the Visitor ID.
I am also responding because I am confused by your objective. Under the assumption that the purpose of the _paq array is to gather and send site information to the Matomo server, why are you using it to collect information from same?
Roddy
I am no longer surprised, as it appears that you can use the _paq array to trigger custom function calls to the Matomo server – something that I have yet to do, but might very well save me an HTTP call with cURL in a different context.
Hi @Kiusau,
Thank you for your response. My objective with this project is to track users who visit our site from our email newsletters. I include our unique customer ID in to the email url parameters. Which gets passed on to motomo using javascript client in the landing page. Problem is tracking the users movement within the site once they leave the landing page. So we have created custom dimension to save off the user id in the landing page. Then in every other page we plan to check if the custom dimension exists in the session and set that to user ID . If the custom dimension does not exist, we would use the visitor ID as the user id. At least this is what we are trying to achieve.
Currently I’m not able to figure out how to get the values of custom dimension / visitor ID back from motomo (or the local cookie , wherever the values are stored).
Like I mentioned in the original post with visitor ID, I’m able to get the value inside the function. Just can’t find away to access it later down in my code.
Any suggestions ?
If possible, can you give me a sample of how you use HTTP call to retrieve custom variables/userID/dimensions ? Just want to have a fall back option if the original idea does not work.
Sorry if I’m asking basic questions. I’m a complete nube at this.
Thanks Roddy,
I think I might work with the Http api you provided. For now we have decided to implement a cookie to hold the info and use custom dimensions to tie the analytics together.
Will let you know we manage to churn up something useful.
Cheers,
Joseph
PS: apologies for the delay in response. Had to jump in to another project that was way past due date.