Quantcast
Channel: Piwik Forums - Support & Bugs
Viewing all articles
Browse latest Browse all 13117

Custom variables - all pages go to one visitor, and seems to log only one visitor at a time.

$
0
0
I set up custom variables for the visit and for the page. I pull the LoginID to Piwik, and that is working. However, there are two issues that I am unable to resolve, and can find no answers in all of the searches I have done here for the past week.
Issue 1: If I am logged in, Piwik sees me and logs my page visits, but if someone else logs in while I am logged in, Piwik does not see that person.
Issue 2: Piwik does not see anyone outside of my organization. When a friend logged in from his home, using my login credentials on his pc, Piwik did not see him. When a coworker logged in from his home, using his login credentials, Piwik saw him.
I have spent this week trying to make sense of this, and searching for others who might have this same issue, but without success. Here is my code: I would very much appreciate any suggestions or guidance. Many thanks!

<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
_paq.push(["setCookieDomain", "*.kirbyrisk.com"]);
_paq.push(["setDomains", ["*.kirbyrisk.com","*.igatedev.kirbyrisk.com"]]);
// you can set up to 5 custom variables for each visitor
_paq.push(["setCustomVariable", 1, "login4visit", "<% if(user.isLoggedIn()){%> <%=user.getLoginID()%><%} else {%>Not Logged In 768 Visit<%} %>" , "visit"]);
// you can set up to 5 custom variables for each action (page view, download, click, site search)
_paq.push(["setCustomVariable", 1, "login4page", "<% if(user.isLoggedIn()){%> <%=user.getLoginID()%><%} else {%>Not Logged In 771 Page<%} %>" , "page"]);
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);

(function() {
var u=(("https:" == document.location.protocol) ? "https" : "http") + "://krwebreport.com/";
_paq.push(["setTrackerUrl", u+"piwik.php"]);
_paq.push(["setSiteId", "2"]);
var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript";
g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Piwik Code -->
<!-- Piwik Image Tracker for users not using JavaScript -->
<noscript>
<img src="http://krwebreport.com/piwik.php?idsite=2&amp;rec=1" style="border:0" alt="" />
<noscript>
<!-- End Piwik image tracking for users not using JavaScript-->

<!-- End Piwik Code -->

Viewing all articles
Browse latest Browse all 13117

Trending Articles