The point platform which can collect the events of user.
Require:
Edit conf.json
file, fill your mysql info.
Run:
npm install
npm start
It will listen 3000 port and receive data form '/events'
Import sdk:
<script src="https://example.com/sdk/1.0/browser.js"></script>
Init sdk to set built-in info and send a point:
(function () {
const eventSender = new EventSender('https://example.com/events', {
// ses sdk/browser.ts#EventBody
uid: 123456,
app_name: 'my-app',
get referer() { return location.href; },
});
eventSender.setContent({
ua: navigator.userAgent,
});
// Send a point
eventSender.send('pv', {
// extra data
});
})();
docker run pea3nut/point-hub:master
It will expose 80, 3000 and 3306 port for:
ALTER TABLE `events` ADD `date` INT NULL AFTER `uid`;
ALTER TABLE `events` ADD INDEX(`date`);
update point-server
Run sql, it need some time:
UPDATE `events` SET `date` = date_format(time, '%Y%m%d') where date is NULL;