Commit Graph

34 Commits (11368e51434abbe18b769dcfdbf6fbf8e413f39f)

Author SHA1 Message Date
RobertJoonas c0da024b23
Remove static tracker files (#2116)
* remove tracker files from git index

* generate tracker files on npm test

* generate tracker files for elixir tests/dev/CI

* update tracker/package-lock.json

* exclude npm run deploy from mix test + some docs
4 years ago
RobertJoonas f75d5106f0
Rework outbound links and file downloads (#2208)
* moved custom event code to the bottom + fix indentation

* add handlebars helper fn + extract getLinkEl fn

* extract isOutboundLink function

* extract shouldFollowLink function

* remove middle and click variables

* use only one click handler for outbounds and downloads

* extract sendLinkClickEvent function

* add error handling when script compilation fails

* use callback instead of fixed timeout

* do not prevent default if externally prevented + test

* add more tests

* generate tracker files in priv/tracker/js

* update changelog

* requested changes after review

* regenerate tracker files

* use return instead of else if

* move middleMouseButton outside the function
4 years ago
RobertJoonas 39ce850f18
exclude pages by hash when using `script.exclusions.hash.js` (#2172)
* account for hash part of the URL when excluding pages and using hash extension

* changelog update
4 years ago
Uku Taht 99fd101135
Add basic test harness for browserstack/playwright (#1961)
* Add basic test harness for browserstack/playwright

* Refactor the tests

* added the first test for outbound links

* tests for outbound-links and file-downloads

* added more browser versions to test on

* Lint tracker test files

* Update harness.js with BrowserStack example

* Fix Playwright request mocks

* Add test harness to CI

* Remove Safari on Windows from browsers list

Co-authored-by: Robert <robertjoonas16@gmail.com>
Co-authored-by: Vinicius Brasil <vini@hey.com>
4 years ago
RobertJoonas 11654ddc07
Script extension additions (#1915)
* added data-include attribute to plausible.exclusions.js

* reorder extensions in filename when serving the plausible script

* fix formatting

* tweaks after review

* changelog update
5 years ago
RobertJoonas 199206babc
Dimensions continued (#1847)
* added the first version of dimensions extension

* finished dimensions script extension + updated tracking to use it

* script variants build
5 years ago
RobertJoonas 83ab092f6c
added add-file-types attribute + now ignores query params (#1831)
* added add-file-types attribute + now ignores query params

* variable extraction + adjustments to general code style
5 years ago
RobertJoonas 8616dd46fb
added file-downloads script extension (#1775)
* added file-downloads script extension

* fixed the issues and made it compatible with IE

* changelog update
5 years ago
Uku Taht e4b99dbad6
Fix Security error with localstorage access (#1568)
* Fix Security error with localstorage access

* Changelog
5 years ago
Émile Perron fbd6e37767
Add option to specify a URL in the manual extension (#1479)
* Add option to specify a URL in the manual extension

* Fix error when option parameter isn't provided
The uglify-js dependency had to be updated to support the optional chaining operator

* Remove the possibility to pass a function for the custom URL
This added weight unnecessarily, as the users can simply call the function themselves before triggering the event.

* Change optional chaining to ternary for improved browser support

* Revert package-lock.json to version 3.9.4 of uglify-js
It was previously updated to support optional chaining; reverting it as a reminder that this is the current browser support level that is accepted by Plausible.
5 years ago
Uku Taht 086d4de74e Remove window.phantom from automated browser detection
Fixes #1403
5 years ago
Uku Taht 23a4f37ab4 Add 'manual' script variant 5 years ago
Uku Taht a7eab3f17b Add null check to localstorage access
Fixes #1225
5 years ago
Uku Taht 62c5bfcbf8 Use unless instead of if 5 years ago
Uku Taht 7c9ca12a3e Don't use URL in compat mode 5 years ago
Uku Taht a378935aac Add IE11 compatibility mode 5 years ago
Uku Taht 2be99db54d Fix p.js 6 years ago
Uku Taht e80fc7bb8e
Tracker script improvements (#1048)
* Use `document.currentScript` to get script host

* Add data-api
6 years ago
Vignesh Joglekar 7f3e55418b
Changes from static tracker script name assignments to dynamic (#786)
Co-authored-by: Uku Taht <Uku.taht@gmail.com>
6 years ago
Vignesh Joglekar 96633f46b1
Fixes exclude regex eating one character before single * (#861)
* Swaps to Negative Lookbehind for exclude Regex

* Updates to not use negative lookbehind
6 years ago
Vignesh Joglekar fb7a3fef89
Adds data-exclude support and localStorage.plausible_ignore support (#489)
* Adds data-exclude support and plausible_ignore support

* Splits exclusion into separate script option

* localStorage parsing upgrades

* Additional script type additions

I'm unsure about the formatting decision in tracker.ex - lmk.

* Adds new compiled files

This will certainly have conflicts with my other PRs related to the tracking scripts right now, I'll make one extra PR after both are done to ensure they're consolidated into the compiled scripts.

* Moves localStorage blocker out of special script

* Changelog

* Second thoughts on localStorage exclusion

* Updates `*` to not match `/` or whitespace

* Fix formatting

* Removes zero-length asterisks

* Adds support for double glob, zero-length replacements

* Update to reduce size+allow localStorage exclude

Co-authored-by: Uku Taht <Uku.taht@gmail.com>
6 years ago
Uku Taht b724def948 Only register outbound link click if it has a host property
Fixes #398
6 years ago
Uku Taht 392b0b33ee Make outbound link tracking dynamic 6 years ago
Uku Taht 0a530a0f66 Do not use pushState and popState in hash mode 6 years ago
Uku Taht 1b21a26e78 Ignore hash clicks 6 years ago
Uku Taht d0d7b823f8
Browser and OS version (#397)
* Collect browser and OS version

* Display browser version

* Show operating system versions

* Device categorization

* Treat headless chrome like a bot

* Ignore events from automated browsers

* Only take major and minor of the version

* Add tests

* Add CHANGELOG entry

* Add changelog entry for bots

* Store empty value as browser when unknown
6 years ago
Uku Taht f0cbf33d7c
Add tracker feature to automatically track outbound links (#389)
* Add tracker feature to automatically track outbound links

* Precompute templates and allow aliases

* Fix /js/analytics.js

* Remove change to tracking code

* Update CHANGELOG
6 years ago
Uku Taht 0b6e645b44
Rename metadata -> properties (#390) 6 years ago
Uku Taht 40900c7653
Ability to add event metadata (#381)
* Ability to add event metadata

* Close Dropdown on outside click

* Show (none) value in metadata breakdown

* Allow filtering for metadata key/val pairs

* Use correct clickhouse_ecto

* Better naming for meta filter

* Add tests

* Add changelog entry

* Remove change made for testing
6 years ago
Uku Taht 3a99b8a4fb
Handle page visibility change when preloading (#311) 6 years ago
Uku Taht 4aa4dfdcaf
Hash mode (#299)
* Build tracker with hash mode

* Extract hash fragment in hash mode

* Serve new hash-based tracker
6 years ago
Uku Taht d30f17c807
Extract utm_source on the server side (#298)
* Extract utm_source on the server side

* Build tracker scripts
6 years ago
Uku Taht 1519359bbf
Makes the tracker and its payload smaller (#296) 6 years ago
Uku Taht bb36bae15c
Inject base url to tracker at runtime (#78)
* Inject base url to tracker at runtime

* Cache tracker script for 1 hour
7 years ago