Browse Source

UA tracking.

master
severak 2 years ago
parent
commit
3a93732c97
  1. 5
      db/schema.sql
  2. 4
      one.php

5
db/schema.sql

@ -26,5 +26,10 @@ CREATE TABLE "visits" (
CREATE INDEX "visits_site_id_path" ON "visits" ("site_id", "path");
CREATE TABLE "uas" (
"ua" text NOT NULL
);
CREATE UNIQUE INDEX "uas_ua" ON "uas" ("ua");
--

4
one.php

@ -37,6 +37,10 @@ try {
$pdo->run('INSERT INTO visits (site_id, path, ts, is_unique, is_bot, platform, browser, version, ref, width) VALUES (:site_id, :path, :ts, :is_unique, :is_bot, :platform, :browser, :version, :ref, :width)', $data);
if ($config['track_uas']) {
$pdo->run('INSERT OR IGNORE INTO uas(ua) VALUES (:ua)', [':ua'=>$ua]);
}
echo 'OK';
} catch (Exception $exception) {
if ($config['debug']) {

Loading…
Cancel
Save