Collecting user stats/logs on third party sites with javascript

502 Views Asked by At

I want to collect statistic (views/clicks/browser info/etc.) for my javascript widget which installed on third party web-sites and after that provide analytics for each domain owner (such as: on my web site I will create interface in which domain's owner could login and see stats for his domain).

I assume that I need to integrate tracking pixel in my widget. And after that parse all request for that pixels.

I've got several question about architecture and implementation of stats/log collection:

  1. When using tracking pixel do I need to add all stats as GET parameters? for example when browser loads my js-widgwt I could get all parameters in widget's javascript and after that make ajax request: my-stats-domai.com/?widget_id=1&domain=example.com&browser=chrome&city=London&type=view.... or there is another way to get/send all parameters?
  2. What is the easiest/fastest way to collect all users info (browser info, referer, url, get params, etc.)? Maybe there is common approach, logs format or specification for users/visitors log?
  3. When tracking user clicks (or other actions) I assume that I need to use ajax request from onclick?
  4. When using onclick do I need to append all browser info, refferer, etc. to url as GET parameters?
  5. Is there any javascript/jquery plugin that could help me collect user stats on third-party sites? And maybe there is any open source php log-parser for my backend to send logs to datastore (mysql).
  6. Maybe I should use piwik or other tracking systems, but I think that it will be kinda overhead. What is pros/cons of using piwik (or smth. else) for my task?

P.S. If there some useful reading about this theme please share a link.

1

There are 1 best solutions below

1
Grant McNamara On

try using microsoft clarity. They have small screen recordings of the widget and you can view errors, clicks, sites, backlinks and more