analytics/priv
RobertJoonas 57188a402a
Define a better monthly pageview usage (#3564)
* refactor asking for the monthly pageview usage

* add tests for usage and limits section in account settings

* display pageview usage per billing cycle for active subscribers

* disable cycle tabs if no usage

* make current billing cycle whole

...instead of capping it at today's date

* run queries for different cycles concurrently

* fix linebreak bug

* add calculate usage action into CRM

* change some names of assigns

* block subscribing to a plan by pageview usage

Depending on whether the customer has already subscribed or not, checking
their pageview usage is different:

* If they're not subscribed yet, we allow them to subscribe to a plan If
  it their last 30 days usage does not exceed the plan pageview limit by
  more than 15% (30% for when subscribing to a 10k plan)

* For existing subscribers, we'll use the exact same mechanism that we're
  using for locking sites - the last two billing cycles usage. If both
  cycles exceed the plan limit by more than 10% - we don't allow them to
  subscribe to the plan

* apply credo suggestion

* prevent highlight bar overflow

* move disabled classes to button element

* optimize for darkmode

* unify link and text styling on the same horizontal line

'Upgrade' & 'Update billing details' links + billing interval text were
positioned on the same line. The font size was similar, but not the same

* improve exceeded_limits function readability

* Refactor some tests and remove code duplication

* override allow upgrade when limits exceeded

In cases where limits are exceeded, we can set the boolean flag
`allow_next_upgrade_override` to `true` in the CRM. This will allow
the user to upgrade to any plan they want. After they've upgraded or
changed their plan - the flag will automatically reset to `false`.

* only apply upgrade override for exceeded pageview limit

* fix tests on the CI

* make current_cycle usage always displayed by default

* make pageview allowance margin more clear

* add comment
2023-11-30 11:50:44 +00:00
..
data_migrations Data Migration: rewrite funnels that contain duplicate goals (#3361) 2023-09-21 09:08:43 +02:00
ingest_repo Fixup 4cdf843ad: (#3434) 2023-10-17 16:07:06 +02:00
ref_inspector [Continued] Google Analytics import (#1753) 2022-03-10 15:04:59 -06:00
repo Define a better monthly pageview usage (#3564) 2023-11-30 11:50:44 +00:00
static Simplify asset building (#3459) 2023-11-01 16:27:29 +02:00
tracker/js Remove static tracker files (#2116) 2022-10-11 12:19:28 +02:00
ua_inspector Bump ua_inspector/matomo db (#3263) 2023-08-14 16:03:12 +02:00
legacy_plans.json Legacy plans (#3455) 2023-10-25 13:46:55 +03:00
paddle.pem Initial commit 2019-09-02 12:29:19 +01:00
placeholder_favicon.ico Add fallback for favicon (#2279) 2022-09-28 08:55:46 -03:00
plans_v1.json List plan benefits on the new upgrade page (#3444) 2023-10-23 19:42:00 +03:00
plans_v2.json List plan benefits on the new upgrade page (#3444) 2023-10-23 19:42:00 +03:00
plans_v3.json List plan benefits on the new upgrade page (#3444) 2023-10-23 19:42:00 +03:00
plans_v4.json List plan benefits on the new upgrade page (#3444) 2023-10-23 19:42:00 +03:00
referer_favicon_domains.json Additional pre-commit hooks (#1428) 2021-11-03 15:46:12 +01:00
sandbox_plans.json List plan benefits on the new upgrade page (#3444) 2023-10-23 19:42:00 +03:00