Commit Graph

2454 Commits

Author SHA1 Message Date
RobertJoonas
5ba21c04fe
Remove Props FF (#3242)
* stop returning prop_names from /conversions

* remove the old prop-breakdown API route and CSV export

* remove allowed_event_props from CRM

* remove DeprecatedConversions

* remove props FF

* update changelog
2023-08-31 11:14:54 -03:00
Vini Brasil
43a926bdb3
Create new sandbox plans based on V4 (#3308) 2023-08-30 15:41:55 +01:00
Cenk Kücük
4ae0c68397
verify tls connection to clickhouse and postgres (#3254) 2023-08-30 14:34:19 +02:00
hq1
93a7cd5d49
Connect to live socket only on specific pages (#3292)
* Connect to live socket only on specific pages

And disable the "server blip" message on non-dev
environments. It's non actionable to our customers.

* Simplify meta tags rendering
2023-08-28 10:03:06 +02:00
dependabot[bot]
dbc3b91a4b
Bump @playwright/test from 1.37.0 to 1.37.1 in /tracker (#3275)
Bumps [@playwright/test](https://github.com/Microsoft/playwright) from 1.37.0 to 1.37.1.
- [Release notes](https://github.com/Microsoft/playwright/releases)
- [Commits](https://github.com/Microsoft/playwright/compare/v1.37.0...v1.37.1)

---
updated-dependencies:
- dependency-name: "@playwright/test"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-24 14:23:25 -03:00
Vini Brasil
5d9d05c1f6
Usage & Limits section (#3291)
* Update user_settings template to HEEX

* Move site_limit function to Billing.Quota

* Create Billing.Quota.site_usage function

* Move monthly_pageview_limit function to Billing.Quota

* Create Billing.Quota.monthly_pageview_usage function

* Add "Usage & Limits" section to user settings page

* Apply suggestions from code review
2023-08-24 14:22:49 -03:00
Uku Taht
8c870f7c6b Increase sampling test delta to reduce flakyness 2023-08-22 14:06:20 +03:00
Uku Taht
ab4eb75109
Inflate sampled results in Stats.Funnel.funnel/3 (#3270)
* Inflate sampled results in Stats.Funnel.funnel/3

* Add test for sampling

* Update test/plausible/funnels_test.exs

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

* Ignore unused binding

* Use bang version of hash function

---------

Co-authored-by: hq1 <hq@mtod.org>
2023-08-22 12:33:48 +02:00
hq1
df19fad046
Set SECURE_COOKIE=false for local dev (#3289)
Safari won't allow to set it even for localhost
2023-08-22 10:17:01 +03:00
Uku Taht
da3d4366f6
Add login link to 404 page (#3288)
* Add login link to 404 page

* Fix 404 test

* Fix another test
2023-08-22 08:45:38 +02:00
hq1
b9fb6fd1a7
Revert "Revert "Reconfigure session cookie (#3274)" (#3284)" (#3285)
This reverts commit 65f7b4c5cc.
2023-08-22 08:18:08 +02:00
Uku Taht
cc60f1c942
Add new priority email template (#3283)
* Add new priority email template?

* Allow priority email to be sent with not layout

* Use priority email template for priority transactional emails

* Test for postmark message stream
2023-08-21 13:21:20 -03:00
ruslandoga
98d6bf3a4f
fix changelog (#3280)
* fix changelog

* use correct issue link
2023-08-21 10:22:35 -03:00
hq1
65f7b4c5cc
Revert "Reconfigure session cookie (#3274)" (#3284)
This reverts commit 63fabcbb5f.
2023-08-21 10:22:05 -03:00
Vini Brasil
dad787cb4b
Rename allowance to monthly_pageview_limit (#3273)
* Remove unused site_limit_exempt list

* Rename allowance to monthly_pageview_limit
2023-08-21 10:07:27 -03:00
Vini Brasil
48b02c1396
Avoid suggesting plan for trials switching to enterprise plans (#3282)
This commit fixes a bug where the SendTrialNotifications job tried to
suggest a plan for users switching to enterprise plans, resulting in the
exception below:

```
UndefinedFunctionError: function :enterprise.volume/0 is undefined (module :enterprise is not available)
  Module "enterprise", in :enterprise.volume/0
  File "lib/plausible_web/templates/email/trial_upgrade_email.html.eex", line 5, in PlausibleWeb.EmailView."trial_upgrade_email.html"/1
  File "lib/phoenix_view.ex", line 381, in Phoenix.View.render_within/3
  File "lib/phoenix_view.ex", line 557, in Phoenix.View.render_to_iodata/3
  File "lib/phoenix_view.ex", line 564, in Phoenix.View.render_to_string/3
  File "lib/bamboo_phoenix.ex", line 291, in Bamboo.Phoenix.render_text_or_html_email/1
  File "lib/workers/send_trial_notifications.ex", line 67, in Plausible.Workers.SendTrialNotifications.send_today_reminder/1
  File "lib/workers/send_trial_notifications.ex", line 36, in anonymous fn/2 in Plausible.Workers.SendTrialNotifications.perform/1
```
2023-08-21 09:01:50 -03:00
hq1
63fabcbb5f
Reconfigure session cookie (#3274)
* Reconfigure session cookie

* Allow configure secure cookie (#3277)

* Update config/runtime.exs

Co-authored-by: ruslandoga <doga.ruslan@gmail.com>

* fix runtime conf

* Revert "fix runtime conf"

This reverts commit ff37e479e4.

* Revert "Update config/runtime.exs"

This reverts commit 5d9b310b02.

* Revert "Allow configure secure cookie (#3277)"

This reverts commit 7401a2ad3f.

* Read SECURE_COOKIE with defaults per cloud/selfhost

* Include environment in cookie name

* Remove redundant option

* Format

* s/Map.replace/Map.put

* up

* One more try

* Prevent browser refreshes on socket connection error

We'll keep the log and don't make the page look dumb
even if there's some misconfiguration going on.

---------

Co-authored-by: ruslandoga <doga.ruslan@gmail.com>
2023-08-21 11:47:11 +02:00
dependabot[bot]
d6d4d3dd75
Bump @playwright/test from 1.36.2 to 1.37.0 in /tracker (#3255)
Bumps [@playwright/test](https://github.com/Microsoft/playwright) from 1.36.2 to 1.37.0.
- [Release notes](https://github.com/Microsoft/playwright/releases)
- [Commits](https://github.com/Microsoft/playwright/compare/v1.36.2...v1.37.0)

---
updated-dependencies:
- dependency-name: "@playwright/test"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-17 10:03:19 -03:00
Vini Brasil
34f1ddfc8c
Refactor Plausible.Billing.Plans module (#3268)
This pull request introduces a series of improvements to Plausible.Billing.Plans, including:

* Tag the JSON file with the plan version
* Rename the JSON field limit to monthly_pageview_limit
* Move site_limit function to Billing.Plans
* Refactor subscription_interval, allowance and site_limit functions
* Remove unused AnalyzePlans task
2023-08-16 13:38:38 -03:00
Uku Taht
3f9ca35d58
Actually ignore unkown device type (#3267) 2023-08-16 09:40:21 +02:00
Uku Taht
a6bf951852
Ignore unkown device type (#3266) 2023-08-15 13:37:27 +02:00
RobertJoonas
9e9555f719
Improvements to the Properties feature (#3261)
* automatic CONVERSIONS -> PROPS navigation

In the Behaviours section, we'll navigate from Goal Conversions > Properties,
when a goal filter is applied by clicking on an entry in the Goal Conversions
list. This navigation does not happen for pageview goals or special goals (e.g.
'Outbound Link: Click', 'File Download', etc.)

The Behaviours component will remember that the navigation happened in order
to return the user to the previous view when the goal filter is removed.

* ability to store prop_keys per goal in localStorage

* pass the onclick handler to the Details view too

This makes sure that when a  listItem is clicked in the Details view,
the same behaviour (such as changing the Locations tab from 'Countries'
to 'Regions') is called.

* bugfix - always escape pipes when applying goal/prop filters

* disable propkey selection when prop filter applied

* make the propkey selector take up all the width
2023-08-14 18:35:40 +01:00
hq1
e59cda5d93
Fix filter suggestions (#3265)
* Fix filter suggestions

* Mute credo for now
2023-08-14 16:07:03 +02:00
hq1
20d31a8d0d
Bump ua_inspector/matomo db (#3263)
* Bump ua_inspector/matomo db

* Update changelog

* Bump matomo to master

* Pin matomo sha
2023-08-14 16:03:12 +02:00
hq1
49a29d86e8
Make stats controller tests synchronous (#3264) 2023-08-14 10:49:41 -03:00
hq1
bc650c213a
Fix breakdown pagination when filtering by goals (#3251)
* Add a failing test

* Bugfix: breakdown by goal pagination

* Update changelog

* Apply comment about comment
2023-08-10 09:23:21 +02:00
Vini Brasil
059df171bc
Refactor Plausible.Billing.Plans module (#3249)
This commit introduces a series of improvements on the Plans module including function renaming, documentation and readability. This is the groundwork for billing plans.

There should be no actual changes with this commit, therefore no changes in tests either.
2023-08-09 14:33:59 -03:00
Cenk Kücük
ec747ad401
add dockerhub creds optional 2023-08-09 12:45:27 +02:00
hq1
ae3a003d31
Fix filter labels when filtering on clicks from ModalTable (#3247) 2023-08-08 09:57:33 -03:00
hq1
e467324c5a
Disallow small intervals on large ranges (#3245)
* Update interval dropdown based on custom range selection

* Add `monthsBetweenDates` function

* Reassign interval for custom "period" based on local storage

* Generate intervals by period based on stats_start_date

* Account for "custom" and "all" period intervals dynamically
2023-08-08 14:49:19 +02:00
RobertJoonas
eeca63ff4c
Some fixes to the Custom Props feature (#3241)
* rename Properties to Custom Properties in Site Settings

* fix docs link for custom props

* add back the external links for special goal URLs and 404 paths

* grandfathering note
2023-08-07 18:11:14 +01:00
Ёkaterina Krivich
9e26ea2cdf
Add referrers.csv to CSV export (#2624) (#3002)
* Add referrers to csv (#2624)

* Change CHANGELOG

* add missing files

* fix tests

* revert package files changes

* fix typo

* format

* rename
2023-08-07 09:32:01 +02:00
Vini Brasil
8c3b541971
Allow internal prop keys in queries (#3231)
* Remove `Plausible.Sites.set_allowed_event_props/2` function

This commit removes the `Plausible.Sites.set_allowed_event_props/2`
function in favor of `Plausible.Props.allow/2`.

* Allow internal prop keys in queries

This commit allows internal prop keys by default in queries. I decided
not to include internal keys in the database, because they might change
and we'd need to migrate it again.

* remove redundant 'props.' from behaviours/index.js

---------

Co-authored-by: Robert Joonas <robertjoonas16@gmail.com>
2023-08-05 15:13:16 +01:00
Vini Brasil
1fedaf18c3
Remove allowed props list from dashboard data attribute (#3230)
This commit removes the allowed props list from the data attribute
passed to React. The list was used for checking whether props configured
or not. This commit adds a new `hasProps` attribute, and removes the
list.
2023-08-05 14:35:31 +01:00
RobertJoonas
373b8e8201
UI tweaks to Properties and Conversions (#3226)
* fix conversions fetchData limit to the right number

* make Goal Conversions metric column width match Properties

* add more top-margin to Details links in ListReport

* add special handling for url prop in Conversions

* change 'Details' button to 'More' when no additional details

* fix CI

* breakdown by 'path' prop instead for 404 pages

* change the 'MORE' button back to 'DETAILS'

But keep the option of not showing the button when there are less
than 9 list entries.

* capture special props in an object instead (review suggestion)

* Add cloaked link to special goals list

---------

Co-authored-by: Vinicius Brasil <vini@hey.com>
2023-08-03 19:12:38 +01:00
Vini Brasil
59a82288e1
Remove url and path prop keys from suggestions (#3228)
* Remove url prop key from suggestions

This commit prevents the `url` prop key from being suggested by the
props settings page. This prop is used internally for file downloads and
outbound link clicks, and doesn't need to be manually allowed.

* Document Props module
2023-08-03 16:17:44 +01:00
dependabot[bot]
c9f683aaee
Bump handlebars from 4.7.7 to 4.7.8 in /tracker (#3218)
Bumps [handlebars](https://github.com/handlebars-lang/handlebars.js) from 4.7.7 to 4.7.8.
- [Release notes](https://github.com/handlebars-lang/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/v4.7.8/release-notes.md)
- [Commits](https://github.com/handlebars-lang/handlebars.js/compare/v4.7.7...v4.7.8)

---
updated-dependencies:
- dependency-name: handlebars
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-02 13:46:18 +02:00
hq1
054d0655af
[pg migration] Delete account with multiple subscriptions (#3220)
* Migrate user deletion

So that subscriptions, google

* Make CRM deletion functional

* Preload subscriptions in an uniform manner
2023-08-02 13:45:49 +02:00
hq1
92a7e01df5
Trim long URLs, paths and other list items uniformly (#3221)
* Trim long URLs and paths uniformly

* Update
2023-08-02 13:45:35 +02:00
Vini Brasil
06305cce95
Hide creatable option when input matches suggestion (#3217)
This commit fixes a bug where the `Create "apple"` combo box option
would show up even when `apple` was in the suggestions list.
2023-08-01 19:41:56 +01:00
RobertJoonas
232bdd34a1
Conversions listreport (#3215)
* rename conversions.js to deprecated-conversions.js

* add a new Conversions component and switch by props FF

* add a Details view to the new Conversions component

* allow querying conversions with pagination

...and keep the current behaviour for DeprecatedConversions, always returning
page=1 and limit=100

* hide some columns on mobile

* prevent ListReport first column header overflow
2023-08-01 19:33:53 +01:00
RobertJoonas
8ac166b447
Add revenue metrics to Properties report (#3209)
* extract add_exit_rate function

* Change internal API metric names for /entry-pages & /exit-pages

* `unique_entrances` -> `visitors`,
* `total_entrances` -> `visits`,
* `unique_exits` -> `visitors`,
* `total_exits` -> `visits`,

This is just a consistency improvement - the `visitors` metric always means
one thing and there's no need to call it different for entry pages internally.

This commit does not change any noticable behavior. The UI labels are kept
the same and the column headers in the CSV export will also remain the same.

* Change internal API metric names for /conversions

* `unique_conversions` -> `visitors`,
* `total_conversions` -> `events`,

* return revenue metrics from /custom-prop-values (backend)

* be more explicit about which metric is plotted with Bar

* validate that ListReport input metrics actually exist in the API response

* display revenue metrics in the dashboard Properties section

* limit the number of columns shown on mobile

* add revenue metrics to Properties > Details

* review suggestions

* define hiddenOnMobile per metric instead of keeping the first 3

* rewrite if-else block

---------

Co-authored-by: Vini Brasil <vini@hey.com>
2023-08-01 13:52:31 +01:00
Wojtek Mach
26373b2726
Remove unused lib/plausible/mailer_test.exs (#3214)
Seems this file was accidentally placed in lib/ and thus never getting
compiled (cause it's .exs) nor getting mix tested (cause it's not in
test/).
2023-08-01 12:49:30 +01:00
dependabot[bot]
43103b27a9
Bump eslint from 8.45.0 to 8.46.0 in /tracker (#3211)
Bumps [eslint](https://github.com/eslint/eslint) from 8.45.0 to 8.46.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.45.0...v8.46.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-31 09:50:24 +01:00
RobertJoonas
17b9e36a19
Refactor: Standardize API metrics used internally (#3208)
* extract add_exit_rate function

* Change internal API metric names for /entry-pages & /exit-pages

* `unique_entrances` -> `visitors`,
* `total_entrances` -> `visits`,
* `unique_exits` -> `visitors`,
* `total_exits` -> `visits`,

This is just a consistency improvement - the `visitors` metric always means
one thing and there's no need to call it different for entry pages internally.

This commit does not change any noticable behavior. The UI labels are kept
the same and the column headers in the CSV export will also remain the same.

* Change internal API metric names for /conversions

* `unique_conversions` -> `visitors`,
* `total_conversions` -> `events`,
2023-07-31 09:33:37 +01:00
RobertJoonas
7b39328d6c
Props details view (#3196)
* make (none) value in custom prop breakdown add +1 to pagination limit

This is needed because the (none) value is always added to the
breakdown_results **after** fetching those from ClickHouse.

* only include (none) values on the first page of results

* fix percentage metric calculation for paginated results

Instead of summing up the number of visitors from the breakdown results
to get the total, we have to make a separate query to `Stats.aggregate`.
Otherwise, the percentages for each results page will wrongly add up to 100%.

Since imported data for aggregated visitors and other properties (such as
browsers, OSs, etc) live in different tables, we have to tweak the tests to
also include the same number of visitors in the `imported_visitors` table.

* add details view for props

* changelog

* exclude imported data from total
2023-07-28 19:44:56 +01:00
Kris Buist
7c5ebab2c6
Fix the interval selection in the all time view (#3110)
Previously, the interval was always overwritten with the default value, which is determined based on the age of the site.
It should not be overwritten when the interval is explicitly passed by the user
2023-07-27 16:02:16 +01:00
Vini Brasil
d49d68af8f
Create props settings page (#3191) 2023-07-27 15:46:32 +01:00
dependabot[bot]
d47908046f
Bump @playwright/test from 1.35.1 to 1.36.2 in /tracker (#3195)
Bumps [@playwright/test](https://github.com/Microsoft/playwright) from 1.35.1 to 1.36.2.
- [Release notes](https://github.com/Microsoft/playwright/releases)
- [Commits](https://github.com/Microsoft/playwright/compare/v1.35.1...v1.36.2)

---
updated-dependencies:
- dependency-name: "@playwright/test"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-27 14:27:58 +02:00
dependabot[bot]
66bbef36bb
Bump timex from 3.7.8 to 3.7.11 (#3198)
Bumps [timex](https://github.com/bitwalker/timex) from 3.7.8 to 3.7.11.
- [Release notes](https://github.com/bitwalker/timex/releases)
- [Changelog](https://github.com/bitwalker/timex/blob/main/CHANGELOG.md)
- [Commits](https://github.com/bitwalker/timex/commits)

---
updated-dependencies:
- dependency-name: timex
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-27 14:27:41 +02:00