Commit Graph

23 Commits (jsx-conditional-rendering)

Author SHA1 Message Date
RobertJoonas bc835895a2
Rename dimensions script to pageview-props (#2786)
* rename dimensions script to pageview-props

* commit mix.lock change
4 years ago
RobertJoonas 135471c32e
Add tagged-events script extension (#2333)
Adds a new script extension that allows tracking interactions with specific HTML elements on a website. For example - to track link clicks on one specific `<a>` element, you can tag it like this:

```html
<a href=... class="plausible-event-name=<your_event_name>">
```

And you can also tag the link with custom property names and values:

```html
<a href=... class="plausible-event-name=<your_event_name> plausible-event-<your_custom_prop>=<your_value>">
```

Tagging a link as above will send a custom event with the given name and props, if a `click` or `auxclick` browser event happens, and targets the link element.

The tracking behavior is somewhat different based on the HTML element type:  

- `<a>` 
  - triggers on `click` and `auxclick` events
  - intercepts navigation based on the same rules as `outbound-links` and `file-downloads`
- `<form>`
  - triggers on `submit` event
  - always intercepts navigation (calls `form.submit()` after preventing default and sending the Plausible event)
- other (`<img>`, `<button>`, `<span>`, `<div>`, `<h2>`, etc ...)
  - triggers on `click` and `auxclick` events
  - does not prevent default to intercept possible navigation. Simply calls Plausible with the event name and props read from the element class list.
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 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 d1fe1f7e41 Cache the tracking script for 24 hours 5 years ago
Uku Taht 23a4f37ab4 Add 'manual' script variant 5 years ago
Uku Taht 27abbc8ebb Add `script` alias to the filename 5 years ago
Uku Taht 7af62e2cc4 Prevent MIME sniffing for tracker JS
Fixes #1247
5 years ago
Martin DONADIEU 56b485f2e6
feat: add variant local (#1218)
* Update plausible.js

* feat: add new variant

* feat: add allow-localhost

* Update tracker.ex

* Update compile.js

* Update plausible.js

* Update tracker.ex

* Update compile.js

* Update plausible.js
5 years ago
Uku Taht 369f63bc58 Adds an option to rename the script file 5 years ago
Uku Taht adf9c1acfb Add access-control-allow-origin to script HTTP response 5 years ago
Uku Taht a378935aac Add IE11 compatibility mode 5 years ago
Uku Taht d03b31450f Removes cache-control header from tracker file 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
Jon Uhlmann 8516e2c458
Fix: Re-add hash and outbound-links only options 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 81c12884cd
Add elixir action (#526)
* Add elixir action

* Format the codebase

* Add postgresql

* Postgres config

* Run postgres on localhost

* Add clickhouse to CI
6 years ago
Guido Zuidhof 2b1dcd99d3
Add Cross-Origin-Resource-Policy header to script
Hey Plausible devs,

I am trying to embed the `plausible.js` onto a page that has the [`require-corp`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy) header set, which means that for every resource that is loaded they must be clearly marked as cross-origin OK.

The tracker script response currently doesn't have that header set, so I can't load it right now. This would solve that.
6 years ago
Uku Taht 7685239204 Fix tracker plug configuration 6 years ago
Uku Taht 0a7684f3bc Mix format 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