Commit Graph

84 Commits (db5488efa677563cc3fce874f72ccb4e7c939708)

Author SHA1 Message Date
Vini Brasil 8f6224b5de
Revenue tracking: goal conversions and tracker script (#3019)
* Add revenue average and total to Goal Conversions

* Add revenue option to tracker script

* Simplify revenue tracker script
3 years ago
Harry Vangberg 34a6b984c7
Escape domain when creating URL for favicon (#2942)
* Escape domain when constructing favicon URL

A domain may include a slash, and in that case the domain must be
escaped, before it is used as an attribute for the image tag.

* match with 'conn.request_path' instead + test

---------

Co-authored-by: Robert Joonas <robertjoonas16@gmail.com>
4 years ago
Marko Saric 586bbeb8ac
Adding a note to contact us for more API calls (#2858)
this should make it clearer to people that they can get more API capacity when they encounter the "Too many API requests" error
4 years ago
hq1 1d01328287
Allow domain change (#2803)
* Migration (PR: https://github.com/plausible/analytics/pull/2802)

* Implement Site.Domain interface allowing change and expiry

* Fixup seeds so they work with V2_MIGRATION_DONE=1

* Update Sites.Cache so it's capable of multi-keyed lookups

* Implement worker handling domain change expiration

* Implement domain change UI

* Implement transition period for public APIs

* Exclude v2 tests in primary test run

* Update lib/plausible_web/controllers/site_controller.ex

Co-authored-by: Vini Brasil <vini@hey.com>

* Update lib/plausible_web/controllers/site_controller.ex

Co-authored-by: Vini Brasil <vini@hey.com>

* Update moduledoc

* Update changelog

* Remove remnant from previous implementation attempt

* !fixup

* !fixup

* Implement domain change via Sites API

cc @ukutaht

* Update CHANGELOG

* Credo

* !fixup commit missing tests

* Allow continuous domain change within the same site

---------

Co-authored-by: Vini Brasil <vini@hey.com>
4 years ago
RobertJoonas bc835895a2
Rename dimensions script to pageview-props (#2786)
* rename dimensions script to pageview-props

* commit mix.lock change
4 years ago
Adam 4b21b4e6d0
Remove Firewall plug; redundant at infra level (#2730)
* Remove Firewall plug; redundant at infra level

* Update changelog
4 years ago
Vini Brasil 9b32dace3e
Add Content-Security-Policy to favicon Plug (#2489) 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
ruslandoga 0b7870dc4d
improve first launch experience for self-hosters (#2357)
* first launch

* dynamic children, wait for repo

* remove wait_for_repo and app env manipulations

* don't mention free trial in self-hosted pages

* add changelog

* assigns[:is_selfhost] -> @is_selfhost

* better changelog wording

* rm admin_user, admin_email, admin_pwd from app env

* rm DISABLE_AUTH

* redirect / to /login when not authenticated

* remove TODO

* Update lib/plausible_web/controllers/page_controller.ex

Co-authored-by: Uku Taht <Uku.taht@gmail.com>

* format

Co-authored-by: Uku Taht <Uku.taht@gmail.com>
4 years ago
Vinicius Brasil 9220d0034d
OpenTelemetry (OTEL) Implementation (#2317)
This pull request improves the current OpenTelemetry implementation. Currently only 1% of the spans are sent, due to the high volume of ingestion requests to /api/event. I enabled the 1% sampling to /api/event only, recording 100% of the other traces.
4 years ago
Adam Rutkowski 523b114682
Allow super-admin Stats API access for locked sites (#2308) 4 years ago
Adam Rutkowski bf2b6880c5
Block Stats API for locked sites (#2302)
* Extract Sites.locked? predicate

* Lock Stats API when dashboard is locked

* Tidy tests

* Don't pollute application env from tests

* Add changelog entry

* Revert "Add changelog entry"

This reverts commit 76346074f9.
4 years ago
Uku Taht 0bc762bfdc
Fix svg favicons (#2295)
* Overrides content-type for SVG favicons

* Organize favicon rendering

Make sure the placeholder icon is always requested from
/favicon/sources/placeholder

* Run prettier on site-switcher.js

* Yak Shave: upgrade Heroicons to 2.0

* Use HeroIcons instead of custom svg

* Update lib/plausible_web/plugs/favicon.ex

Co-authored-by: Adam Rutkowski <hq@mtod.org>

Co-authored-by: Adam Rutkowski <hq@mtod.org>
4 years ago
Uku Taht d104abb53d
Add fallback for favicon (#2279)
* Add fallback for favicon

* Add Favicon tests

* Changelog

* Move placeholder icon to priv folder
4 years ago
Uku Taht e849e03058
Fix favicons (#2257) 4 years ago
Uku Taht eb99133791 Fix favicon requests 4 years ago
Uku Taht ad739f603b Fix compile error 4 years ago
Uku Taht 57c758cff9 Fix favicon HTTP response handling 4 years ago
Manu S Ajith 777c69b1d6
Migrate HTTPoison to Finch (#2054)
Signed-off-by: Manu S Ajith <neo@codingarena.in>

Signed-off-by: Manu S Ajith <neo@codingarena.in>
4 years ago
ruslandoga ce461b5192 Auth updates 4 years ago
Uku Taht 1cdffb098e Revert "Temporarily return 404 for favicons"
This reverts commit 8d3bdd9816.
4 years ago
Uku Taht 8d3bdd9816 Temporarily return 404 for favicons 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
RobertJoonas 6b22806e1f
Allow admin access to locked dashboards (#1710)
* added super-admin access to locked dashboards

* fixed formatting
5 years ago
Uku Taht d1fe1f7e41 Cache the tracking script for 24 hours 5 years ago
Uku Taht 7e93500834 Allow admins to access the stats API 5 years ago
Uku Taht 23a4f37ab4 Add 'manual' script variant 5 years ago
Uku Taht a7fd23a804 Revert "Reduce database roundtrips on critical path for authorization"
This reverts commit 71d1988ee8.
5 years ago
Uku Taht 71d1988ee8 Reduce database roundtrips on critical path for authorization 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 7e78157c4b
Merge branch 'master' into stats-module 5 years ago
Uku Taht 6758931431 Add plug for source favicons 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 18ddf9dd9d Admin access 6 years ago
Uku Taht 62dfb43f10 Admin access 6 years ago
Uku Taht e71de6dc1f
Invitations (#1122)
* Invite existing user to a site

* Add invitation flow for non-existing users

* Accept and reject invitations

* Use invitation flow for existing users

* Locking mechanism for sites

* Authorization for site settings

* Show usage based on site ownership

* Add ability to remove members from a site

* Do not show settings link to viewer roles

* Ability to remove invitations

* Remove `Plausible.Sites.count_for/1`

* Fix tests

* Do not show the trial banner after the trial

* Correct trial emails

* Transfer ownership

* Send invitation email to existing user

* Add invitation email flows

* Add plug for role-based authorization

* Rename AuthorizeStatsPlug -> AuthorizeSiteAccess

* Add email flow for ownership transfer

* Fix URLs in emails

* Fix small copy issues

* Make 'People' its own section in site settings

* Notify user via email if their access has been removed

* Check site lock status when invitation is accepted

* Check lock status when user subscribes

* Make sure only admins and owners can create shared links

* Changelog

* Add LockSites to daily cron

* Clean invitations after 48 hours

* Add notices about expiry

* Add invitation expired page

* Add doc link
6 years ago
Uku Taht d03b31450f Removes cache-control header from tracker file 6 years ago
Uku Taht 1a93542cd7 Add rate limit to API requests 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
Uku Taht 119b9514b2 Add limit of 20 sites 6 years ago
Uku Taht 7982c236c1 Better Sentry tracking 6 years ago
Uku Taht 70f0657327 Update shared link API 6 years ago
Uku Taht d473accf40 Add API key scopes 6 years ago