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

Uid variable added but getting no userId in Matomo

$
0
0
function matomo(userId) {
  let userId=localStorage.getItem('userEmail');
  console.log("matomo",userId);
  var _mtm = (window._mtm = window._mtm || []);
  // var _paq = window._paq = window._paq || [];
  _mtm.push(["trackPageView"]);
  _mtm.push(["enableLinkTracking"]);
  _mtm.push(["trackAllContentImpressions"]);
  _mtm.push({
    "mtm.startTime": new Date().getTime(),
    event: "mtm.Start",
    uid: userId,
  });
 
  (function () {
    var d = document,
      g = d.createElement("script"),
      s = d.getElementsByTagName("script")[0];
    g.async = true;
    g.src = "";
    s.parentNode.insertBefore(g, s);
  })();
}
We have used this code for tracking userId of logged in user in Angular Project.We are getting userId in console everytime.But in matomo all userId is not saved.We have created uid variable in container and used it.But after that no userId is detected.What is the issue? Please guide us properly.

![image|689x349](upload://7bTQHe4lZYcDpbkX9qPO289Gy9Q.png)

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 5981

Trending Articles