You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
analytics/lib/plausible_web
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
..
controllers Add API support for intervals (#2417) 4 years ago
plugs Add tagged-events script extension (#2333) 4 years ago
templates Merge pull request #2431 from plausible/fix-email-links 4 years ago
views Merge pull request #2431 from plausible/fix-email-links 4 years ago
captcha.ex Include tests for Captcha success/failure scenarios (#2344) 4 years ago
email.ex do not use default layout in internal email 4 years ago
endpoint.ex Remove redundant logger from Plug (#2303) 4 years ago
refinspector.ex [Continued] Google Analytics import (#1753) 5 years ago
remote_ip.ex Parse bunny header 5 years ago
router.ex improve first launch experience for self-hosters (#2357) 4 years ago