diff --git a/README.md b/README.md index dfbb545..5173bcd 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,33 @@ Each example also ships a commented-out `scriptOrigin` option (JS init/component See the Takt docs guide **`/docs/guides/domaine-personnalise`** for how to set up the first-party domain. +## Advanced options (Takt 0.5) + +Each example also wires at least one of the advanced tracker options introduced in +Takt 0.5, so you can see the idiomatic spelling per framework (component prop, +plugin/config key, `data-*` attribute, or `init()` field): + +| Option | What it does | +|--------|--------------| +| `sampleRate` | Fraction of visitors to track (`0`–`1`); lower it to sample. | +| `trackQuery` | Keep the query string on pageview paths instead of stripping it. | +| `queryParams` | Allowlist of query params to keep when `trackQuery` is on. | +| `scrubUrl` | A function that rewrites each URL before it is sent (dev-controlled). | +| `enabled` | Master kill-switch — set to `false` to disable all tracking at runtime. | +| `tagged` | Autocapture clicks on `[data-takt-tag]` elements. | + +Where each option shows up: `vanilla` (`sampleRate`, `tagged`), `react` (`scrubUrl`, +`tagged`), `vue` (`trackQuery`, `queryParams`), `svelte` (`scrubUrl`), `solid` +(`sampleRate`), `angular` (`tagged`), `astro` (`trackQuery`, `queryParams`, +`scrubUrl`). + +`scrubUrl` is a function, so it can't be a `data-*` attribute or survive a JSON +config island. In the JS wrappers it is a real prop; for PHP it requires the new +`Mode::Sdk` renderer, which emits a full `import{init};init({…})` ES module — the +[`php`](php) example shows `Mode::Sdk` + `scrubUrl`, and the +[`laravel`](laravel)/[`symfony`](symfony) configs demonstrate the `data-*` options +(with `scrub_url` + `mode: sdk` shown as a commented switch). + ## License MIT diff --git a/angular/package-lock.json b/angular/package-lock.json index 320fe4d..51a8e06 100644 --- a/angular/package-lock.json +++ b/angular/package-lock.json @@ -13,8 +13,8 @@ "@angular/core": "^20.0.0", "@angular/platform-browser": "^20.0.0", "@angular/router": "^20.0.0", - "@vskstudio/takt-angular": "^0.4.2", - "@vskstudio/takt-core": "^0.4.2", + "@vskstudio/takt-angular": "^0.5.0", + "@vskstudio/takt-core": "^0.5.0", "rxjs": "^7.8.0", "tslib": "^2.6.0", "zone.js": "^0.15.0" @@ -5778,9 +5778,9 @@ } }, "node_modules/@vskstudio/takt-angular": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@vskstudio/takt-angular/-/takt-angular-0.4.2.tgz", - "integrity": "sha512-4gE0qyTT0iJlVw2sPoGPNYOQW/iwsdZDqYSa63FcCVyKwf39eoJaKQFvU7luxheaG+snF92w28GhMcuy15/zRA==", + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@vskstudio/takt-angular/-/takt-angular-0.5.1.tgz", + "integrity": "sha512-rODRtXxNeZSMCk5FIL64hN2mdW+UzcTqmkJEcLsT0Y3uor+tXYppcbae4Gb2mQY2C3MkGeL2x+YYFk1fjT1NvQ==", "license": "MIT", "dependencies": { "tslib": "^2.6.0" @@ -5791,13 +5791,13 @@ "peerDependencies": { "@angular/common": ">=17", "@angular/core": ">=17", - "@vskstudio/takt-core": ">=0.4.2" + "@vskstudio/takt-core": ">=0.5.0" } }, "node_modules/@vskstudio/takt-core": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@vskstudio/takt-core/-/takt-core-0.4.2.tgz", - "integrity": "sha512-/FaR5CKHqPaOYqu62+8dQ9rU89KvvN+y7FRjWksZGcIwkWUdv9vLYVKNl6fVIHu/GEUJXghGSuaoN6rXIB4XvA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@vskstudio/takt-core/-/takt-core-0.5.0.tgz", + "integrity": "sha512-lblPk/YDYtqZfxMS5t4dkA+lgojDNND6TF42nyyam4kLdyvzM0dwBOsbY2sC9WYL8gRj3dxI53rF/r5Q+p2PVQ==", "license": "MIT", "engines": { "node": ">=18" diff --git a/angular/package.json b/angular/package.json index c90d542..5ddc93c 100644 --- a/angular/package.json +++ b/angular/package.json @@ -12,8 +12,8 @@ "@angular/core": "^20.0.0", "@angular/platform-browser": "^20.0.0", "@angular/router": "^20.0.0", - "@vskstudio/takt-angular": "^0.4.2", - "@vskstudio/takt-core": "^0.4.2", + "@vskstudio/takt-angular": "^0.5.0", + "@vskstudio/takt-core": "^0.5.0", "rxjs": "^7.8.0", "tslib": "^2.6.0", "zone.js": "^0.15.0" diff --git a/angular/src/app/app.component.ts b/angular/src/app/app.component.ts index 7d44535..8273052 100644 --- a/angular/src/app/app.component.ts +++ b/angular/src/app/app.component.ts @@ -16,6 +16,8 @@ import { TaktService, TaktEventDirective } from '@vskstudio/takt-angular'; > Sign up (declarative) + + `, }) diff --git a/angular/src/main.ts b/angular/src/main.ts index 0c753ff..a92eca0 100644 --- a/angular/src/main.ts +++ b/angular/src/main.ts @@ -11,6 +11,9 @@ bootstrapApplication(AppComponent, { track404: true, excludeLocalhost: false, // scriptOrigin: 'https://stats.example.com', // first-party : sert le tracker depuis votre domaine (anti-adblock) + // Advanced options (Takt 0.5): + tagged: true, // autocapture clicks on [data-takt-tag] elements + // enabled: false, // master kill-switch — disables all tracking at runtime }), ], }).catch((err) => console.error(err)); diff --git a/astro/astro.config.mjs b/astro/astro.config.mjs index 75161da..0bc7f92 100644 --- a/astro/astro.config.mjs +++ b/astro/astro.config.mjs @@ -8,7 +8,18 @@ import takt from '@vskstudio/takt-astro' // import Takt from '@vskstudio/takt-astro/Takt.astro' -> in export default defineConfig({ integrations: [ + // Advanced options (Takt 0.5): keep only the listed query params on pageviews; + // scrubUrl (integration-only — it can't cross the JSON island) rewrites + // each URL before send. It is stringified at build time, so keep it self-contained. // scriptOrigin: 'https://stats.example.com' -> first-party : sert le tracker depuis votre domaine (anti-adblock) - takt({ domain: 'example.com', endpoint: '/api/event', track404: true, excludeLocalhost: false }), + takt({ + domain: 'example.com', + endpoint: '/api/event', + track404: true, + excludeLocalhost: false, + trackQuery: true, + queryParams: ['utm_source', 'utm_medium', 'utm_campaign'], + scrubUrl: (url) => url.split('#')[0], + }), ], }) diff --git a/astro/package-lock.json b/astro/package-lock.json index ce219aa..449f65a 100644 --- a/astro/package-lock.json +++ b/astro/package-lock.json @@ -6,8 +6,8 @@ "": { "name": "@vskstudio/takt-example-astro", "dependencies": { - "@vskstudio/takt-astro": "^0.4.2", - "@vskstudio/takt-core": "^0.4.2", + "@vskstudio/takt-astro": "^0.5.0", + "@vskstudio/takt-core": "^0.5.0", "astro": "^5.0.0" }, "devDependencies": { @@ -1847,22 +1847,22 @@ "license": "MIT" }, "node_modules/@vskstudio/takt-astro": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@vskstudio/takt-astro/-/takt-astro-0.4.2.tgz", - "integrity": "sha512-qhE0LJr9O4tuHdDGsUGrq0RAu5ilCjK9ye093pHqA23jfsm0eWfydvx5SBOahs+lueIrEFTn7XYh+PpQZK25zQ==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@vskstudio/takt-astro/-/takt-astro-0.5.0.tgz", + "integrity": "sha512-9b5uMmWZB5YRqq8hqKfNtc7EPgKw4/Ra0eZGNswjwW7KxJJlzDPluO2MGfFhUXCfG2l7mVV2hgA/BhfhERTITg==", "license": "MIT", "engines": { "node": ">=18" }, "peerDependencies": { - "@vskstudio/takt-core": ">=0.4.2", + "@vskstudio/takt-core": ">=0.5.0", "astro": ">=4" } }, "node_modules/@vskstudio/takt-core": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@vskstudio/takt-core/-/takt-core-0.4.2.tgz", - "integrity": "sha512-/FaR5CKHqPaOYqu62+8dQ9rU89KvvN+y7FRjWksZGcIwkWUdv9vLYVKNl6fVIHu/GEUJXghGSuaoN6rXIB4XvA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@vskstudio/takt-core/-/takt-core-0.5.0.tgz", + "integrity": "sha512-lblPk/YDYtqZfxMS5t4dkA+lgojDNND6TF42nyyam4kLdyvzM0dwBOsbY2sC9WYL8gRj3dxI53rF/r5Q+p2PVQ==", "license": "MIT", "engines": { "node": ">=18" diff --git a/astro/package.json b/astro/package.json index 5edf980..7a11923 100644 --- a/astro/package.json +++ b/astro/package.json @@ -8,8 +8,8 @@ "preview": "astro preview" }, "dependencies": { - "@vskstudio/takt-astro": "^0.4.2", - "@vskstudio/takt-core": "^0.4.2", + "@vskstudio/takt-astro": "^0.5.0", + "@vskstudio/takt-core": "^0.5.0", "astro": "^5.0.0" }, "devDependencies": { diff --git a/laravel/composer.json b/laravel/composer.json index 82b286b..fa5d91b 100644 --- a/laravel/composer.json +++ b/laravel/composer.json @@ -6,7 +6,7 @@ "require": { "php": ">=8.1", "laravel/framework": "^11.0 || ^12.0", - "vskstudio/takt-laravel": "^0.1" + "vskstudio/takt-laravel": "^0.3" }, "autoload": { "psr-4": { "App\\": "app/" } }, "config": { diff --git a/laravel/composer.lock b/laravel/composer.lock index 152d8c7..9df68cc 100644 --- a/laravel/composer.lock +++ b/laravel/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "feb841184a3bd366f93a36f4bb0c7224", + "content-hash": "dfd5101171a9a443abcf554676ed6cbf", "packages": [ { "name": "brick/math", @@ -643,22 +643,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.11.1", + "version": "7.12.1", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "5af96f374e0ab4ebd747b8310888c99d3adb0a8c" + "reference": "d34627490fbc03bf5c5d7cfed81f2faa19519425" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/5af96f374e0ab4ebd747b8310888c99d3adb0a8c", - "reference": "5af96f374e0ab4ebd747b8310888c99d3adb0a8c", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d34627490fbc03bf5c5d7cfed81f2faa19519425", + "reference": "d34627490fbc03bf5c5d7cfed81f2faa19519425", "shasum": "" }, "require": { "ext-json": "*", "guzzlehttp/promises": "^2.5", - "guzzlehttp/psr7": "^2.11", + "guzzlehttp/psr7": "^2.12.1", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.5 || ^3.0", @@ -671,7 +671,7 @@ "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", "guzzle/client-integration-tests": "3.0.2", - "guzzlehttp/test-server": "^0.5", + "guzzlehttp/test-server": "^0.5.1", "php-http/message-factory": "^1.1", "phpunit/phpunit": "^8.5.52 || ^9.6.34", "psr/log": "^1.1 || ^2.0 || ^3.0" @@ -751,7 +751,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.11.1" + "source": "https://github.com/guzzle/guzzle/tree/7.12.1" }, "funding": [ { @@ -767,7 +767,7 @@ "type": "tidelift" } ], - "time": "2026-06-07T22:54:06+00:00" + "time": "2026-06-18T14:12:49+00:00" }, { "name": "guzzlehttp/promises", @@ -855,16 +855,16 @@ }, { "name": "guzzlehttp/psr7", - "version": "2.11.0", + "version": "2.12.1", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "bbb5e61349fa5cb822b3e87842b951088b76b81f" + "reference": "172ef2f4e9824c1e058b7f30be8ae25a02c0f2b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/bbb5e61349fa5cb822b3e87842b951088b76b81f", - "reference": "bbb5e61349fa5cb822b3e87842b951088b76b81f", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/172ef2f4e9824c1e058b7f30be8ae25a02c0f2b7", + "reference": "172ef2f4e9824c1e058b7f30be8ae25a02c0f2b7", "shasum": "" }, "require": { @@ -954,7 +954,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.11.0" + "source": "https://github.com/guzzle/psr7/tree/2.12.1" }, "funding": [ { @@ -970,7 +970,7 @@ "type": "tidelift" } ], - "time": "2026-06-02T12:30:48+00:00" + "time": "2026-06-18T09:49:37+00:00" }, { "name": "guzzlehttp/uri-template", @@ -2064,16 +2064,16 @@ }, { "name": "nesbot/carbon", - "version": "3.11.4", + "version": "3.13.0", "source": { "type": "git", "url": "https://github.com/CarbonPHP/carbon.git", - "reference": "e890471a3494740f7d9326d72ce6a8c559ffee60" + "reference": "40f6618f052df16b545f626fbf9a878e6497d16a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/e890471a3494740f7d9326d72ce6a8c559ffee60", - "reference": "e890471a3494740f7d9326d72ce6a8c559ffee60", + "url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/40f6618f052df16b545f626fbf9a878e6497d16a", + "reference": "40f6618f052df16b545f626fbf9a878e6497d16a", "shasum": "" }, "require": { @@ -2165,7 +2165,7 @@ "type": "tidelift" } ], - "time": "2026-04-07T09:57:54+00:00" + "time": "2026-06-18T13:49:15+00:00" }, { "name": "nette/schema", @@ -3100,20 +3100,20 @@ }, { "name": "ramsey/uuid", - "version": "4.9.2", + "version": "4.9.3", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "8429c78ca35a09f27565311b98101e2826affde0" + "reference": "1df15849d00943a67d677dc9cfd80795f038c9f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/8429c78ca35a09f27565311b98101e2826affde0", - "reference": "8429c78ca35a09f27565311b98101e2826affde0", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/1df15849d00943a67d677dc9cfd80795f038c9f8", + "reference": "1df15849d00943a67d677dc9cfd80795f038c9f8", "shasum": "" }, "require": { - "brick/math": "^0.8.16 || ^0.9 || ^0.10 || ^0.11 || ^0.12 || ^0.13 || ^0.14", + "brick/math": ">=0.8.16 <=0.18", "php": "^8.0", "ramsey/collection": "^1.2 || ^2.0" }, @@ -3172,9 +3172,9 @@ ], "support": { "issues": "https://github.com/ramsey/uuid/issues", - "source": "https://github.com/ramsey/uuid/tree/4.9.2" + "source": "https://github.com/ramsey/uuid/tree/4.9.3" }, - "time": "2025-12-14T04:43:48+00:00" + "time": "2026-06-18T03:57:49+00:00" }, { "name": "symfony/clock", @@ -5895,16 +5895,16 @@ }, { "name": "vskstudio/takt-core-php", - "version": "v0.1.2", + "version": "v0.3.0", "source": { "type": "git", "url": "https://github.com/vskstudio/takt-core-php.git", - "reference": "48ebcb35ebd89fbbbba8039e1b72c5c970de9efb" + "reference": "b148357c23192d235cba3e2dd30b704a5abb392a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vskstudio/takt-core-php/zipball/48ebcb35ebd89fbbbba8039e1b72c5c970de9efb", - "reference": "48ebcb35ebd89fbbbba8039e1b72c5c970de9efb", + "url": "https://api.github.com/repos/vskstudio/takt-core-php/zipball/b148357c23192d235cba3e2dd30b704a5abb392a", + "reference": "b148357c23192d235cba3e2dd30b704a5abb392a", "shasum": "" }, "require": { @@ -5949,27 +5949,27 @@ "issues": "https://github.com/vskstudio/takt-core-php/issues", "source": "https://github.com/vskstudio/takt-core-php" }, - "time": "2026-06-12T22:13:10+00:00" + "time": "2026-06-19T19:05:16+00:00" }, { "name": "vskstudio/takt-laravel", - "version": "v0.1.1", + "version": "v0.3.0", "source": { "type": "git", "url": "https://github.com/vskstudio/takt-laravel.git", - "reference": "89c1ce7396fe95bd05eafd843ea8bd8905ae0070" + "reference": "404c7a7bda7712ec5c66e139cffc28166819a516" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vskstudio/takt-laravel/zipball/89c1ce7396fe95bd05eafd843ea8bd8905ae0070", - "reference": "89c1ce7396fe95bd05eafd843ea8bd8905ae0070", + "url": "https://api.github.com/repos/vskstudio/takt-laravel/zipball/404c7a7bda7712ec5c66e139cffc28166819a516", + "reference": "404c7a7bda7712ec5c66e139cffc28166819a516", "shasum": "" }, "require": { "guzzlehttp/guzzle": "^7.8", "illuminate/support": "^10.0 || ^11.0 || ^12.0", "php": ">=8.1", - "vskstudio/takt-core-php": "^0.1" + "vskstudio/takt-core-php": "^0.3" }, "require-dev": { "laravel/pint": "^1.16", @@ -6016,7 +6016,7 @@ "issues": "https://github.com/vskstudio/takt-laravel/issues", "source": "https://github.com/vskstudio/takt-laravel" }, - "time": "2026-06-12T22:13:57+00:00" + "time": "2026-06-19T19:32:41+00:00" } ], "packages-dev": [], diff --git a/laravel/config/takt.php b/laravel/config/takt.php index 592fdb8..648f951 100644 --- a/laravel/config/takt.php +++ b/laravel/config/takt.php @@ -11,4 +11,14 @@ 'files' => false, // Fire events during local development (Takt's privacy default is true). 'exclude_localhost' => false, + + // Advanced options (Takt 0.5). Rendered as data-* attributes; a null/default + // value is simply omitted. + 'sample_rate' => 1, // fraction of visitors to track (0–1); lower it to sample + 'track_query' => true, // keep the query string on pageviews... + 'query_params' => ['utm_source', 'utm_medium', 'utm_campaign'], // ...but only these + // 'respect_dnt' => false, // disable the Do-Not-Track short-circuit + // scrub_url is a JS function: set 'mode' => 'sdk' to render init({...}) and + // uncomment the line below (it throws in cdn/inline/asset mode). + // 'scrub_url' => '(u) => u.split("#")[0]', ]; diff --git a/php/composer.json b/php/composer.json index 874b651..c0c6061 100644 --- a/php/composer.json +++ b/php/composer.json @@ -5,7 +5,7 @@ "license": "MIT", "require": { "php": ">=8.1", - "vskstudio/takt-core-php": "^0.1", + "vskstudio/takt-core-php": "^0.3", "nyholm/psr7": "^1.8", "symfony/http-client": "^6.4 || ^7.0" }, diff --git a/php/composer.lock b/php/composer.lock index ca83968..13056d6 100644 --- a/php/composer.lock +++ b/php/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "465bac5d93cbb5e383d7650f1a98d6da", + "content-hash": "107dfb1314117100f280cf73537df70a", "packages": [ { "name": "nyholm/psr7", @@ -849,16 +849,16 @@ }, { "name": "vskstudio/takt-core-php", - "version": "v0.1.2", + "version": "v0.3.0", "source": { "type": "git", "url": "https://github.com/vskstudio/takt-core-php.git", - "reference": "48ebcb35ebd89fbbbba8039e1b72c5c970de9efb" + "reference": "b148357c23192d235cba3e2dd30b704a5abb392a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vskstudio/takt-core-php/zipball/48ebcb35ebd89fbbbba8039e1b72c5c970de9efb", - "reference": "48ebcb35ebd89fbbbba8039e1b72c5c970de9efb", + "url": "https://api.github.com/repos/vskstudio/takt-core-php/zipball/b148357c23192d235cba3e2dd30b704a5abb392a", + "reference": "b148357c23192d235cba3e2dd30b704a5abb392a", "shasum": "" }, "require": { @@ -903,7 +903,7 @@ "issues": "https://github.com/vskstudio/takt-core-php/issues", "source": "https://github.com/vskstudio/takt-core-php" }, - "time": "2026-06-12T22:13:10+00:00" + "time": "2026-06-19T19:05:16+00:00" } ], "packages-dev": [], @@ -916,8 +916,5 @@ "php": ">=8.1" }, "platform-dev": {}, - "platform-overrides": { - "php": "8.3.0" - }, "plugin-api-version": "2.9.0" } diff --git a/php/index.php b/php/index.php index 5839d0e..4487b01 100644 --- a/php/index.php +++ b/php/index.php @@ -9,13 +9,21 @@ use Vskstudio\Takt\Options; use Vskstudio\Takt\SnippetRenderer; +// Mode::Sdk renders a full `import{init};init({...})` ES module instead of the +// lightweight data-* snippet. It is the only mode able to express scrubUrl — a +// JS function grafted as raw code — and it carries every advanced option. $snippet = (new SnippetRenderer(new Options( domain: 'example.com', endpoint: 'https://takt.example.com', - mode: Mode::Cdn, + mode: Mode::Sdk, // scriptOrigin: 'https://stats.example.com', // first-party : sert le tracker depuis votre domaine (anti-adblock) // Fire events during local development (Takt's privacy default is true). excludeLocalhost: false, + // Advanced options (Takt 0.5): + sampleRate: 1.0, // fraction of visitors to track (0–1); lower it to sample, e.g. 0.25 + trackQuery: true, // keep the query string on pageviews... + queryParams: ['utm_source', 'utm_medium', 'utm_campaign'], // ...but only these params + scrubUrl: '(u) => u.split("#")[0]', // raw JS, Mode::Sdk only — here: drop the #fragment )))->render(); ?> diff --git a/react/package-lock.json b/react/package-lock.json index 6fbd6fb..6febf1f 100644 --- a/react/package-lock.json +++ b/react/package-lock.json @@ -8,8 +8,8 @@ "name": "@vskstudio/takt-example-react", "version": "0.0.0", "dependencies": { - "@vskstudio/takt-core": "^0.4.2", - "@vskstudio/takt-react": "^0.4.2", + "@vskstudio/takt-core": "^0.5.0", + "@vskstudio/takt-react": "^0.5.0", "react": "^19.0.0", "react-dom": "^19.0.0" }, @@ -1285,24 +1285,24 @@ } }, "node_modules/@vskstudio/takt-core": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@vskstudio/takt-core/-/takt-core-0.4.2.tgz", - "integrity": "sha512-/FaR5CKHqPaOYqu62+8dQ9rU89KvvN+y7FRjWksZGcIwkWUdv9vLYVKNl6fVIHu/GEUJXghGSuaoN6rXIB4XvA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@vskstudio/takt-core/-/takt-core-0.5.0.tgz", + "integrity": "sha512-lblPk/YDYtqZfxMS5t4dkA+lgojDNND6TF42nyyam4kLdyvzM0dwBOsbY2sC9WYL8gRj3dxI53rF/r5Q+p2PVQ==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@vskstudio/takt-react": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@vskstudio/takt-react/-/takt-react-0.4.2.tgz", - "integrity": "sha512-2DffVzwewCnp4VQsMYVd87uYn36mUiKqyUzXHWqAkeovu92QEgJL1LWk3w+Sw7FeObs3ZpushO8ilJYecDiX9Q==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@vskstudio/takt-react/-/takt-react-0.5.0.tgz", + "integrity": "sha512-SvlN40lVcYMTljV/HN93dbf3NJEB2Aocic7EWH2ac1ps51UpZbjkXJo05eIrYg2B0Dj37215zAcIM9m2Fftbsg==", "license": "MIT", "engines": { "node": ">=18" }, "peerDependencies": { - "@vskstudio/takt-core": ">=0.4.2", + "@vskstudio/takt-core": ">=0.5.0", "react": "^18 || ^19" } }, diff --git a/react/package.json b/react/package.json index b25db94..286a7a1 100644 --- a/react/package.json +++ b/react/package.json @@ -9,8 +9,8 @@ "preview": "vite preview" }, "dependencies": { - "@vskstudio/takt-core": "^0.4.2", - "@vskstudio/takt-react": "^0.4.2", + "@vskstudio/takt-core": "^0.5.0", + "@vskstudio/takt-react": "^0.5.0", "react": "^19.0.0", "react-dom": "^19.0.0" }, diff --git a/react/src/App.tsx b/react/src/App.tsx index 188cae1..9108adb 100644 --- a/react/src/App.tsx +++ b/react/src/App.tsx @@ -5,12 +5,26 @@ import { Takt, TaktEvent, useTakt, useTaktEvent } from '@vskstudio/takt-react' // disabled here so events are emitted during local development. export default function App() { return ( + // Advanced options (Takt 0.5): tagged autocaptures [data-takt-tag] clicks; + // scrubUrl rewrites the URL before it is sent (here: drop the #fragment). // scriptOrigin="https://stats.example.com" : sert le tracker depuis votre domaine (first-party / anti-adblock) - + url.split('#')[0]} + excludeLocalhost={false} + >

Takt React Example

+ {/* Autocaptured by `tagged` — no handler needed. */} +
) diff --git a/solid/package-lock.json b/solid/package-lock.json index 8d966e6..db6f2cf 100644 --- a/solid/package-lock.json +++ b/solid/package-lock.json @@ -8,8 +8,8 @@ "name": "@vskstudio/takt-example-solid", "version": "0.0.0", "dependencies": { - "@vskstudio/takt-core": "^0.4.2", - "@vskstudio/takt-solid": "^0.4.2", + "@vskstudio/takt-core": "^0.5.0", + "@vskstudio/takt-solid": "^0.5.0", "solid-js": "^1.8.0" }, "devDependencies": { @@ -1167,24 +1167,24 @@ "license": "MIT" }, "node_modules/@vskstudio/takt-core": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@vskstudio/takt-core/-/takt-core-0.4.2.tgz", - "integrity": "sha512-/FaR5CKHqPaOYqu62+8dQ9rU89KvvN+y7FRjWksZGcIwkWUdv9vLYVKNl6fVIHu/GEUJXghGSuaoN6rXIB4XvA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@vskstudio/takt-core/-/takt-core-0.5.0.tgz", + "integrity": "sha512-lblPk/YDYtqZfxMS5t4dkA+lgojDNND6TF42nyyam4kLdyvzM0dwBOsbY2sC9WYL8gRj3dxI53rF/r5Q+p2PVQ==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@vskstudio/takt-solid": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@vskstudio/takt-solid/-/takt-solid-0.4.2.tgz", - "integrity": "sha512-bJLwzPXvLXmXdKVDKUUW5uZNGWsjql33AAURBgT9glJQ+ymLUvbK1QBOe9X026PlyuKeugRFKjyctuwDHF/5vA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@vskstudio/takt-solid/-/takt-solid-0.5.0.tgz", + "integrity": "sha512-zOqnVJCMT5/mVMGXfwSl9XJuCrP6Fq0kk2XIV0kdBBteLuElwvtrdNDIqqMpiy1HvdKP1b8i1+QLXEZfU6Q1Kg==", "license": "MIT", "engines": { "node": ">=18" }, "peerDependencies": { - "@vskstudio/takt-core": ">=0.4.2", + "@vskstudio/takt-core": ">=0.5.0", "solid-js": "^1.8" } }, diff --git a/solid/package.json b/solid/package.json index 998a171..17f1d1d 100644 --- a/solid/package.json +++ b/solid/package.json @@ -9,8 +9,8 @@ "preview": "vite preview" }, "dependencies": { - "@vskstudio/takt-core": "^0.4.2", - "@vskstudio/takt-solid": "^0.4.2", + "@vskstudio/takt-core": "^0.5.0", + "@vskstudio/takt-solid": "^0.5.0", "solid-js": "^1.8.0" }, "devDependencies": { diff --git a/solid/src/App.tsx b/solid/src/App.tsx index 8139dbf..6028fe5 100644 --- a/solid/src/App.tsx +++ b/solid/src/App.tsx @@ -17,8 +17,10 @@ const BuyButton: Component = () => { const App: Component = () => ( // domain + default /api/event endpoint; fires the initial pageview. // excludeLocalhost={false} so events fire during local dev. + // Advanced option (Takt 0.5): sampleRate is the fraction of visitors to track + // (0–1); lower it to sample, e.g. 0.25. // scriptOrigin="https://stats.example.com" : sert le tracker depuis votre domaine (first-party / anti-adblock) - +

Takt + SolidJS

diff --git a/svelte/package-lock.json b/svelte/package-lock.json index e2fe6c2..3bc7c9f 100644 --- a/svelte/package-lock.json +++ b/svelte/package-lock.json @@ -8,8 +8,8 @@ "name": "@vskstudio/takt-example-svelte", "version": "0.0.0", "dependencies": { - "@vskstudio/takt-core": "^0.4.2", - "@vskstudio/takt-svelte": "^0.4.2" + "@vskstudio/takt-core": "^0.5.0", + "@vskstudio/takt-svelte": "^0.5.0" }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "^5.1.1", @@ -976,24 +976,24 @@ "license": "MIT" }, "node_modules/@vskstudio/takt-core": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@vskstudio/takt-core/-/takt-core-0.4.2.tgz", - "integrity": "sha512-/FaR5CKHqPaOYqu62+8dQ9rU89KvvN+y7FRjWksZGcIwkWUdv9vLYVKNl6fVIHu/GEUJXghGSuaoN6rXIB4XvA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@vskstudio/takt-core/-/takt-core-0.5.0.tgz", + "integrity": "sha512-lblPk/YDYtqZfxMS5t4dkA+lgojDNND6TF42nyyam4kLdyvzM0dwBOsbY2sC9WYL8gRj3dxI53rF/r5Q+p2PVQ==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@vskstudio/takt-svelte": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@vskstudio/takt-svelte/-/takt-svelte-0.4.2.tgz", - "integrity": "sha512-SdFSiNjKCQE6TomEe4QIDsFDKkASc5FvKsLoCNLGib973lm7MvhrahVp0oyVCHVZhYgyWXakBc3ZUPpHxOjyCw==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@vskstudio/takt-svelte/-/takt-svelte-0.5.0.tgz", + "integrity": "sha512-4HWd+4zM1tz9tAx3fHXnpuaZDYRTfNS7H30Rs2P9TAs4uvSM7gf4F6JkzktGU+PB0G0gCzvW8u7CoWRk4k0qfA==", "license": "MIT", "engines": { "node": ">=18" }, "peerDependencies": { - "@vskstudio/takt-core": ">=0.4.2", + "@vskstudio/takt-core": ">=0.5.0", "svelte": "^5.19.0" } }, diff --git a/svelte/package.json b/svelte/package.json index 09ca0f3..e881118 100644 --- a/svelte/package.json +++ b/svelte/package.json @@ -9,8 +9,8 @@ "preview": "vite preview" }, "dependencies": { - "@vskstudio/takt-core": "^0.4.2", - "@vskstudio/takt-svelte": "^0.4.2" + "@vskstudio/takt-core": "^0.5.0", + "@vskstudio/takt-svelte": "^0.5.0" }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "^5.1.1", diff --git a/svelte/src/App.svelte b/svelte/src/App.svelte index 8a8e376..6f1eb73 100644 --- a/svelte/src/App.svelte +++ b/svelte/src/App.svelte @@ -12,8 +12,15 @@ + - + url.split('#')[0]} + excludeLocalhost={false} +/>

Takt + Svelte 5

diff --git a/symfony/composer.json b/symfony/composer.json index 5381c19..990ead7 100644 --- a/symfony/composer.json +++ b/symfony/composer.json @@ -8,7 +8,7 @@ "symfony/framework-bundle": "^6.4 || ^7.0", "symfony/http-client": "^6.4 || ^7.0", "symfony/twig-bundle": "^6.4 || ^7.0", - "vskstudio/takt-symfony": "^0.1" + "vskstudio/takt-symfony": "^0.3" }, "autoload": { "psr-4": { "App\\": "src/" } }, "config": { diff --git a/symfony/composer.lock b/symfony/composer.lock index c8eafe1..a9638aa 100644 --- a/symfony/composer.lock +++ b/symfony/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "79036ca526639bc55e2be85d7b86034c", + "content-hash": "c92edb2b3f2cc03839d6b33810524cbb", "packages": [ { "name": "nyholm/psr7", @@ -2902,16 +2902,16 @@ }, { "name": "vskstudio/takt-core-php", - "version": "v0.1.2", + "version": "v0.3.0", "source": { "type": "git", "url": "https://github.com/vskstudio/takt-core-php.git", - "reference": "48ebcb35ebd89fbbbba8039e1b72c5c970de9efb" + "reference": "b148357c23192d235cba3e2dd30b704a5abb392a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vskstudio/takt-core-php/zipball/48ebcb35ebd89fbbbba8039e1b72c5c970de9efb", - "reference": "48ebcb35ebd89fbbbba8039e1b72c5c970de9efb", + "url": "https://api.github.com/repos/vskstudio/takt-core-php/zipball/b148357c23192d235cba3e2dd30b704a5abb392a", + "reference": "b148357c23192d235cba3e2dd30b704a5abb392a", "shasum": "" }, "require": { @@ -2956,20 +2956,20 @@ "issues": "https://github.com/vskstudio/takt-core-php/issues", "source": "https://github.com/vskstudio/takt-core-php" }, - "time": "2026-06-12T22:13:10+00:00" + "time": "2026-06-19T19:05:16+00:00" }, { "name": "vskstudio/takt-symfony", - "version": "v0.1.1", + "version": "v0.3.0", "source": { "type": "git", "url": "https://github.com/vskstudio/takt-symfony.git", - "reference": "cdddf3739aa7a0345f721cc4e09c794a150e8bb6" + "reference": "e21ea8c3a4901daa800c4c2e85b1494f8515df96" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vskstudio/takt-symfony/zipball/cdddf3739aa7a0345f721cc4e09c794a150e8bb6", - "reference": "cdddf3739aa7a0345f721cc4e09c794a150e8bb6", + "url": "https://api.github.com/repos/vskstudio/takt-symfony/zipball/e21ea8c3a4901daa800c4c2e85b1494f8515df96", + "reference": "e21ea8c3a4901daa800c4c2e85b1494f8515df96", "shasum": "" }, "require": { @@ -2977,7 +2977,7 @@ "php": ">=8.1", "symfony/framework-bundle": "^6.4 || ^7.0", "symfony/http-client": "^6.4 || ^7.0", - "vskstudio/takt-core-php": "^0.1" + "vskstudio/takt-core-php": "^0.3" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.59", @@ -3014,7 +3014,7 @@ "issues": "https://github.com/vskstudio/takt-symfony/issues", "source": "https://github.com/vskstudio/takt-symfony" }, - "time": "2026-06-12T22:14:41+00:00" + "time": "2026-06-19T19:32:52+00:00" } ], "packages-dev": [], diff --git a/symfony/config/packages/takt.yaml b/symfony/config/packages/takt.yaml index d7b7e77..2cad4f5 100644 --- a/symfony/config/packages/takt.yaml +++ b/symfony/config/packages/takt.yaml @@ -7,3 +7,13 @@ takt: mode: 'cdn' # Fire events during local development (Takt's privacy default is true). exclude_localhost: false + + # Advanced options (Takt 0.5). Rendered as data-* attributes; a null/default + # value is simply omitted. + sample_rate: 1 # fraction of visitors to track (0–1); lower it to sample + track_query: true # keep the query string on pageviews... + query_params: ['utm_source', 'utm_medium', 'utm_campaign'] # ...but only these + # respect_dnt: false # disable the Do-Not-Track short-circuit + # scrub_url is a JS function: set mode: 'sdk' to render init({...}) and + # uncomment the line below (it throws in cdn/inline/asset mode). + # scrub_url: '(u) => u.split("#")[0]' diff --git a/vanilla/package-lock.json b/vanilla/package-lock.json index 4f92277..ba75eca 100644 --- a/vanilla/package-lock.json +++ b/vanilla/package-lock.json @@ -8,7 +8,7 @@ "name": "@vskstudio/takt-example-vanilla", "version": "0.0.0", "dependencies": { - "@vskstudio/takt-core": "^0.4.2" + "@vskstudio/takt-core": "^0.5.0" }, "devDependencies": { "typescript": "^5.4.0", @@ -803,9 +803,9 @@ "license": "MIT" }, "node_modules/@vskstudio/takt-core": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@vskstudio/takt-core/-/takt-core-0.4.2.tgz", - "integrity": "sha512-/FaR5CKHqPaOYqu62+8dQ9rU89KvvN+y7FRjWksZGcIwkWUdv9vLYVKNl6fVIHu/GEUJXghGSuaoN6rXIB4XvA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@vskstudio/takt-core/-/takt-core-0.5.0.tgz", + "integrity": "sha512-lblPk/YDYtqZfxMS5t4dkA+lgojDNND6TF42nyyam4kLdyvzM0dwBOsbY2sC9WYL8gRj3dxI53rF/r5Q+p2PVQ==", "license": "MIT", "engines": { "node": ">=18" diff --git a/vanilla/package.json b/vanilla/package.json index d0cd9de..bce9769 100644 --- a/vanilla/package.json +++ b/vanilla/package.json @@ -8,7 +8,7 @@ "build": "tsc --noEmit && vite build" }, "dependencies": { - "@vskstudio/takt-core": "^0.4.2" + "@vskstudio/takt-core": "^0.5.0" }, "devDependencies": { "typescript": "^5.4.0", diff --git a/vanilla/src/main.ts b/vanilla/src/main.ts index 8127317..6c0d3d0 100644 --- a/vanilla/src/main.ts +++ b/vanilla/src/main.ts @@ -7,6 +7,9 @@ init({ auto: true, notFound: true, excludeLocalhost: false, + // Advanced options (Takt 0.5): + sampleRate: 1, // fraction of visitors to track (0–1); lower it to sample, e.g. 0.25 + tagged: true, // autocapture clicks on [data-takt-tag] elements // scriptOrigin: 'https://stats.example.com', // first-party : sert le tracker depuis votre domaine (anti-adblock) }) diff --git a/vue/package-lock.json b/vue/package-lock.json index 0a1e848..ca4cb09 100644 --- a/vue/package-lock.json +++ b/vue/package-lock.json @@ -8,8 +8,8 @@ "name": "@vskstudio/takt-example-vue", "version": "0.0.0", "dependencies": { - "@vskstudio/takt-core": "^0.4.2", - "@vskstudio/takt-vue": "^0.4.2", + "@vskstudio/takt-core": "^0.5.0", + "@vskstudio/takt-vue": "^0.5.0", "vue": "^3.5.0" }, "devDependencies": { @@ -902,24 +902,24 @@ } }, "node_modules/@vskstudio/takt-core": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@vskstudio/takt-core/-/takt-core-0.4.2.tgz", - "integrity": "sha512-/FaR5CKHqPaOYqu62+8dQ9rU89KvvN+y7FRjWksZGcIwkWUdv9vLYVKNl6fVIHu/GEUJXghGSuaoN6rXIB4XvA==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@vskstudio/takt-core/-/takt-core-0.5.0.tgz", + "integrity": "sha512-lblPk/YDYtqZfxMS5t4dkA+lgojDNND6TF42nyyam4kLdyvzM0dwBOsbY2sC9WYL8gRj3dxI53rF/r5Q+p2PVQ==", "license": "MIT", "engines": { "node": ">=18" } }, "node_modules/@vskstudio/takt-vue": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@vskstudio/takt-vue/-/takt-vue-0.4.2.tgz", - "integrity": "sha512-yQ8qoAG8atoVYTVmvXGfnEl0vQtgA0gXRsGkWWcDuxy9rFweaFqf7Ytdit9+vJfpWx6FumP87YXMIJOQnrjstQ==", + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@vskstudio/takt-vue/-/takt-vue-0.5.0.tgz", + "integrity": "sha512-ZWY4/1CIXHjzUZz8+LIBiTEBOiivy9RNtjzYBLx3R2ItxDQ9ZuA67q9qxS200dOoGyXOG6bKlkjmLPZKhcfp5g==", "license": "MIT", "engines": { "node": ">=18" }, "peerDependencies": { - "@vskstudio/takt-core": ">=0.4.2", + "@vskstudio/takt-core": ">=0.5.0", "vue": "^3.3.0" } }, diff --git a/vue/package.json b/vue/package.json index 353969f..5133838 100644 --- a/vue/package.json +++ b/vue/package.json @@ -9,8 +9,8 @@ "preview": "vite preview" }, "dependencies": { - "@vskstudio/takt-core": "^0.4.2", - "@vskstudio/takt-vue": "^0.4.2", + "@vskstudio/takt-core": "^0.5.0", + "@vskstudio/takt-vue": "^0.5.0", "vue": "^3.5.0" }, "devDependencies": { diff --git a/vue/src/main.ts b/vue/src/main.ts index a18e0fc..fd07a6d 100644 --- a/vue/src/main.ts +++ b/vue/src/main.ts @@ -12,6 +12,10 @@ app.use(TaktPlugin, { endpoint: 'https://example.com/api/event', track404: true, excludeLocalhost: false, + // Advanced options (Takt 0.5): keep the query string on pageviews, but only + // the listed params (drops everything else, e.g. session ids). + trackQuery: true, + queryParams: ['utm_source', 'utm_medium', 'utm_campaign'], // scriptOrigin: 'https://stats.example.com', // first-party : sert le tracker depuis votre domaine (anti-adblock) })