* 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
* 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>
* 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
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
```
* 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>
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
* 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
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.
* 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
* 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
* 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>
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.
* 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>
* 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
* 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
* 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>
* 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`,
* 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
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