Commit Graph

9 Commits

Author SHA1 Message Date
Artur Pata 757cf95070
Script v2: Adds linter and prettier, satisfies linter (#5691)
* Install deps and create config

* Satisfy linter in tests

* Silence redeclare warnings

* Remove shadowed/redeclared variables

* Update changelog
2025-09-04 04:56:42 +00:00
Karl-Aksel Puulmann 619a9ed57b
ScriptV2: Use async instead of defer, new snippet (#5655)
* async -> defer

* Run legacy tests using async instead of defer
2025-08-25 07:12:11 +00:00
Karl-Aksel Puulmann b36a92fb45
ScriptV2: snippet structure change (#5662)
* Remove dead code

* Use a new snippet style

* Allow plausible to be on window
2025-08-25 05:35:06 +00:00
Artur Pata a2df9a986c
Script v2: Add more diagnostics cases to verifier v2, more tests for verifier v2 (#5620)
* Add more diagnostics cases to verifier v2, more tests for verifier v2

* Remove extraneous text from CSP in tests
2025-08-11 10:43:59 +00:00
Artur Pata 9c35a0f47c
Script v2: Handle exceptions on clicks on links within svgs (#5538)
* Access href attribute more defensively to avoid uncaught errors

WIP

chore: Bump tracker_script_version to 22

Try accept limitation

Clarify issue with tagged link clicks within svgs

Fix potential error chain accessing object

Revert fixes about tagged events props

* Refactor script tests
2025-08-04 10:10:08 +00:00
RobertJoonas b76996b3a4
Verification v2 (#5549)
* new verifier script with tests + telemetry

* dataDomainMismatch tests

* more tests for callbackStatus and plausibleInstalled

* create priv/verifier subfolder + fix Elixir CI

* bump CI cache version

* organize verifier tests

* Remove accidentally committed verifier

* Rework compilation: Make it a variant, always return new verifier code in tests

* Make priv/tracker/verifier/ exist

* Handle static checks with grace

* Fix paths

* Fix paths

* Add some tests

* Add one more test

* split up the JS

* proxyLikely + code structure refactor + unit tests

* fix telemetry fields

* move most telemetry to logs

* run verifier tests only on chromium

* detect wordpressPlugin and wordpressLikely

* detect GTM

* rename JS checks

* detect cookiebot

* include new fields in logs

* different logs for browserless request vs js failures

* detect manual extension

* detect unknown attrs + fix logging

* stick to Elixir checks for snippet detection

* fix codespell

* fix IO.inspect

* remove unnecessary fields from test mock

* cookiebot doc

* move test into verifier subfolder

* do not duplicate ts types

* comma -> semicolon in log

* test dynamically loaded snippet

* improve logging on Browserless error

---------

Co-authored-by: Karl-Aksel Puulmann <oxymaccy@gmail.com>
2025-07-14 14:32:21 +00:00
Artur Pata 74dddc241c
Script v2: Remove delays except when using .compat extension (#5465)
* Make delays conditional on COMPILE_COMPAT, otherwise rely on keepalive fetch

* Add tests

* Fix webkit related test file-download feature tests issues

* Remove ternaries for scriptConfig in tests

* Make sure .compat scripts don't contain unreachable code blocks

* Test legacy .compat extension in a separate block

* Tests for tagged events

* Remove extraneous tests, add needed tests

* Add tests for v2 features overlap and outbound link clicks

* Add changelog, add current behaviour test for outbound links

* Remove mockRequest, unify API

* Fix coverage of legacy compat navigation, add back interactive event test

* chore: Bump tracker_script_version to 21

* Update specs

* Fix issues with _ variable

* Fix args

* Types and formatting cleanup

---------

Co-authored-by: apata <apata@users.noreply.github.com>
2025-06-27 12:10:02 +00:00
Karl-Aksel Puulmann 98cdeb23dd
ScriptV2: Configuration renames, iteration (#5427)
* plausible-main -> plausible-web

* Change elixir workflow

* Update tracker option names in tracker.ex

* config.hash -> config.hashBasedRouting

* Enable revenue by default for plausible-web

* Enable taggedEvents by default

* config.local -> config.captureOnLocalhost

* manual -> autoCapturePageviews

* Update playwright tests

* Support adding/editing file types for download in plausible-web

Original docs: https://plausible.io/docs/file-downloads-tracking#what-if-i-want-to-track-a-different-file-type

* rebase: initialize-page-dynamically update

* chore: Bump tracker_script_version to 12

* Ignore pageviews in file-downloads.spec

* Phrasing in tests

* Remove unneeded conditional
2025-05-27 11:28:17 +00:00
Artur Pata 9be012362c
Track form submission events (#5381)
* Track form submissions

* chore: Bump tracker_script_version to 11

* Check that script loadedin tests

* Track form submissions

* Fix format

* Fix missing form submit handler

* Make id casing consistent

* Automatically sync compiled script snippet in dynamic test pages

* Enforce format manually

* Skip one test on Firefox, explain reason for stub

* Revert "Automatically sync compiled script snippet in dynamic test pages"

This reverts commit 7622b23f31.

---------

Co-authored-by: apata <apata@users.noreply.github.com>
2025-05-26 06:30:21 +00:00