Answer the question
In order to leave comments, you need to log in
Is there a JavaScript script to store web analytics on the client side?
You need a JS script that will allow you to save information about the visit in cookies (where did you come from, if from a search, then what request, what pages did you visit). Tried to use the cookies that google analytics makes. The results are not very accurate.
Answer the question
In order to leave comments, you need to log in
HTML5 localstorage will help. You can store any data there, not just analytics (and everything is on the client side)
What does "results are inaccurate" mean? If you have Google Analytics (not universal), then parse the __utmz cookie, and that's it. That is, using Google Analytics on the site, the following data is already available in cookies:
1. Where did you come from (source / medium)
2. Keyword (if available)
Regarding "what pages you visited": you can use the JS History Object www.w3schools.com/ jsref/obj_history.asp
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question