Quantcast
Channel: Support & Bugs - Matomo forums
Viewing all articles
Browse latest Browse all 5706

Help retreaving values using javascript client api

$
0
0

@jchandy wrote:

anyone who can help,

Hi ,
Need help to understand how to get a value using Piwik finctions (like getVisitorId, getCustomeDimentions etc…?

This is the code I have used

var visitor_id;
_paq.push([ function () { visitor_id = this.getVisitorId(); }]);
console.log(visitor_id);

My console keep showing that the variable is undefined.

If I change the code to

var visitor_id;
_paq.push([ function () { visitor_id = this.getVisitorId(); console.log(visitor_id); }]);

cosole will show the correct ID.
I need to to access the visitor_ID variable later on in the script.

I know this is not strictly a piwik/motomo question. But I’m a nube at javascripts and would apreciate any help.

Joseph

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 5706

Trending Articles