csv-export-oban
no-team-in-self-hosted
sync-imported-data-in-site-imports-data-migration
gh-pages
master
request-logging
new-top-report-action
top-report-refactor
con-cache-patch-test
clean-site-ch-data
entry-exit-hostnames-schema
simplify
dependabot/npm_and_yarn/tracker/express-4.19.2
rename-build-names
migration-for-3918
dependabot/npm_and_yarn/tracker/eslint-plugin-playwright-1.5.4
reload-after-config
dependabot/hex/csv-3.2.1
pr-3887-review
fix-timezones
gzip
reapply-cache-change2
consistency-api
journey-rebased
metmarkosaric-patch-1
journey
dependabot/npm_and_yarn/assets/chart.js-4.4.2
pr-3800-refactor-wip
drop-event-columns
not-goals
exclude-in-api
poc-clickhouse-metadata-queries
feat-tag-ch-queries
fix/site-locker-no-trial-with-sub
time-on-page-improvements
feat/2fa-final-bigger-refactor
feat/parse-x-vercel-forwarded-for
fix/live-flash-messages-in-sites
feat/2fa-poc
fix/invite-modal-message
bt-bugs
modals
fix/redirect-to-people-settings-after-removing-pending-invitation
props-settings-ui-keyboard-propagation
login-404
fix-sessions-pageview-query
revenue-tracking-wip
monetary-values
tagged-events-bug-repro
pr-2841
jsx-conditional-rendering
bounce-rate-entry-page-poc
disable-site-creation
support-multiple-filters-frontend
custom-comparison-mode-end-date-spike
site_inserted_at_limit
ua-device-type
chartjs-upgrade
ua-device-type-ecto-query
not-set-patch
sentry-frontend-integration
process-per-ip
v1.4
v1.2
v1.5.0-rc.0
list
r000000-0-test
r2022.10.10-1
r2022.10.10-2
r2022.10.11-3
r2022.10.13-4
r2022.10.13-5
r2022.10.17-6
r2022.10.18-7
r2022.10.19-8
r2022.10.24-10
r2022.10.24-9
r2022.10.25-11
r2022.10.26-12
r2022.10.27-13
r2022.11.02-14
r2022.11.03-15
r2022.11.09-16
r2022.11.10-17
r2022.11.15-18
r2022.11.21-19
r2022.11.22-20
r2022.11.22-21
r2022.11.24-22
r2022.11.25-23
r2022.11.28-24
r2022.11.29-25
r2022.11.30-26
r2022.12.02-27
r2022.12.19-28
r2022.12.22-29
r2022.12.27-30
r2023.01.02-31
r2023.01.02-32
r2023.01.04-33
r2023.01.05-34
r2023.01.11-35
r2023.01.11-36
r2023.01.12-37
r2023.01.12-38
r2023.01.16-39
r2023.01.17-40
r2023.01.19-41
r2023.01.19-42
r2023.01.19-43
r2023.01.23-44
r2023.01.24-45
r2023.01.25-46
r2023.01.31-47
r2023.02.01-48
r2023.02.01-49
r2023.02.02-50
r2023.02.06-51
r2023.02.07-52
r2023.02.07-53
r2023.02.12-54
r2023.02.14-55
r2023.02.15-56
r2023.02.21-57
r2023.02.22-58
r2023.02.22-59
r2023.02.22-60
r2023.02.23-61
r2023.02.23-62
r2023.02.23-63
r2023.02.27-64
r2023.03.01-65
r2023.03.01-66
r2023.03.02-67
r2023.03.06-68
r2023.03.07-69
r2023.03.07-70
r2023.03.08-71
r2023.03.10-72
r2023.03.13-73
r2023.03.14-74
r2023.03.15-75
r2023.03.15-76
r2023.03.20-77
r2023.03.21-78
r2023.03.21-79
r2023.03.22-80
r2023.03.22-81
r2023.03.23-82
r2023.03.24-83
r2023.03.27-84
r2023.03.27-85
r2023.03.28-86
r2023.03.28-87
r2023.03.30-88
r2023.04.04-89
r2023.04.04-90
r2023.04.04-91
r2023.04.04-92
r2023.04.04-93
r2023.04.04-94
r2023.04.05-95
r2023.04.05-96
r2023.04.06-97
r2023.04.07-98
r2023.04.10-100
r2023.04.10-99
r2023.04.11-101
r2023.04.13-102
r2023.04.24-103
r2023.04.26-104
r2023.04.27-105
r2023.05.02-106
r2023.05.03-107
r2023.05.04-108
r2023.05.09-109
r2023.05.10-110
r2023.05.16-111
r2023.05.16-112
r2023.05.17-113
r2023.05.18-114
r2023.05.22-115
r2023.05.23-116
r2023.05.24-117
r2023.05.25-118
r2023.06.01-119
r2023.06.07-120
r2023.06.12-121
r2023.06.12-122
r2023.06.12-123
r2023.06.13-124
r2023.06.13-125
r2023.06.13-126
r2023.06.14-127
r2023.06.14-128
r2023.06.19-129
r2023.06.20-130
r2023.06.23-131
r2023.06.27-132
r2023.06.27-133
r2023.06.27-134
r2023.06.28-135
r2023.06.28-136
r2023.06.28-137
r2023.06.28-138
r2023.07.04-139
r2023.07.06-140
r2023.07.11-141
r2023.07.11-142
r2023.07.11-143
r2023.07.11-144
r2023.07.12-145
r2023.07.13-146
r2023.07.17-147
r2023.07.18-148
r2023.07.19-149
r2023.07.21-150
r2023.07.24-151
r2023.07.24-152
r2023.07.24-153
r2023.07.24-154
r2023.07.26-155
r2023.07.27-156
r2023.07.27-157
r2023.07.31-158
r2023.08.01-159
r2023.08.02-160
r2023.08.03-161
r2023.08.05-162
r2023.08.07-163
r2023.08.08-164
r2023.08.09-165
r2023.08.10-166
r2023.08.14-167
r2023.08.14-168
r2023.08.15-169
r2023.08.16-170
r2023.08.17-171
r2023.08.21-172
r2023.08.21-173
r2023.08.22-174
r2023.08.22-175
r2023.08.22-176
r2023.08.24-177
r2023.08.28-178
r2023.08.30-179
r2023.08.31-180
r2023.09.04-181
r2023.09.04-182
r2023.09.05-183
r2023.09.05-184
r2023.09.05-185
r2023.09.07-186
r2023.09.12-187
r2023.09.12-188
r2023.09.13-189
r2023.09.13-190
r2023.09.18-191
r2023.09.18-192
r2023.09.21-193
r2023.09.25-194
r2023.09.26-195
r2023.09.28-196
r2023.10.02-197
r2023.10.02-198
r2023.10.02-199
r2023.10.03-200
r2023.10.04-201
r2023.10.05-202
r2023.10.09-203
r2023.10.10-204
r2023.10.10-205
r2023.10.10-206
r2023.10.11-207
r2023.10.11-208
r2023.10.11-209
r2023.10.12-210
r2023.10.13-211
r2023.10.16-212
r2023.10.16-213
r2023.10.17-214
r2023.10.17-215
r2023.10.18-216
r2023.10.18-217
r2023.10.23-218
r2023.10.24-219
r2023.10.25-220
r2023.10.25-221
r2023.10.30-222
r2023.10.30-223
r2023.10.31-224
r2023.11.01-225
r2023.11.01-226
r2023.11.02-227
r2023.11.02-228
r2023.11.02-229
r2023.11.02-230
r2023.11.02-231
r2023.11.02-232
r2023.11.02-233
r2023.11.06-234
r2023.11.06-235
r2023.11.08-236
r2023.11.08-237
r2023.11.08-238
r2023.11.08-239
r2023.11.09-240
r2023.11.10-241
r2023.11.10-242
r2023.11.13-243
r2023.11.13-244
r2023.11.13-245
r2023.11.13-246
r2023.11.14-247
r2023.11.14-248
r2023.11.16-249
r2023.11.17-250
r2023.11.17-251
r2023.11.17-252
r2023.11.17-253
r2023.11.20-254
r2023.11.20-255
r2023.11.20-256
r2023.11.20-257
r2023.11.21-258
r2023.11.23-259
r2023.11.28-260
r2023.11.29-261
r2023.11.29-262
r2023.11.30-263
r2023.11.30-264
r2023.11.30-265
r2023.11.30-266
r2023.11.30-267
r2023.12.04-268
r2023.12.04-269
r2023.12.05-270
r2023.12.06-271
r2023.12.06-272
r2023.12.06-273
r2023.12.06-274
r2023.12.06-275
r2023.12.07-276
r2023.12.11-277
r2023.12.11-278
r2023.12.11-279
r2023.12.11-280
r2023.12.12-281
r2023.12.12-282
r2023.12.12-283
r2023.12.13-284
r2023.12.13-285
r2023.12.13-286
r2023.12.13-287
r2023.12.14-288
r2023.12.14-289
r2023.12.14-290
r2023.12.15-291
r2023.12.20-292
r2023.12.20-293
r2023.12.21-294
r2023.12.21-295
r2023.12.28-296
r2024.01.02-297
r2024.01.02-298
r2024.01.02-299
r2024.01.02-300
r2024.01.03-301
r2024.01.03-302
r2024.01.03-303
r2024.01.04-304
r2024.01.04-305
r2024.01.04-306
r2024.01.08-307
r2024.01.08-308
r2024.01.08-309
r2024.01.09-310
r2024.01.09-311
r2024.01.09-312
r2024.01.11-313
r2024.01.11-314
r2024.01.15-315
r2024.01.15-316
r2024.01.15-317
r2024.01.15-318
r2024.01.22-319
r2024.01.22-320
r2024.01.22-321
r2024.01.22-322
r2024.01.22-323
r2024.01.22-324
r2024.01.22-325
r2024.01.23-326
r2024.01.23-327
r2024.01.25-328
r2024.01.27-329
r2024.01.27-330
r2024.01.27-331
r2024.01.29-332
r2024.01.29-333
r2024.01.29-334
r2024.01.29-335
r2024.01.30-336
r2024.02.01-337
r2024.02.01-338
r2024.02.01-339
r2024.02.01-340
r2024.02.01-341
r2024.02.07-342
r2024.02.12-343
r2024.02.12-344
r2024.02.12-345
r2024.02.12-346
r2024.02.12-347
r2024.02.12-348
r2024.02.13-349
r2024.02.13-350
r2024.02.14-351
r2024.02.14-352
r2024.02.14-353
r2024.02.14-354
r2024.02.15-355
r2024.02.15-356
r2024.02.15-357
r2024.02.15-358
r2024.02.15-359
r2024.02.19-360
r2024.02.20-361
r2024.02.21-362
r2024.02.21-363
r2024.02.21-364
r2024.02.22-365
r2024.02.22-366
r2024.02.23-367
r2024.02.23-368
r2024.02.26-369
r2024.02.26-370
r2024.02.26-371
r2024.02.27-372
r2024.02.27-373
r2024.02.27-374
r2024.02.27-375
r2024.02.27-376
r2024.02.27-377
r2024.02.28-378
r2024.02.28-379
r2024.02.28-380
r2024.03.01-381
r2024.03.05-382
r2024.03.06-383
r2024.03.06-384
r2024.03.08-385
r2024.03.08-386
r2024.03.08-387
r2024.03.11-388
r2024.03.12-389
r2024.03.12-390
r2024.03.12-391
r2024.03.12-392
r2024.03.12-393
r2024.03.13-394
r2024.03.14-395
r2024.03.18-396
r2024.03.18-397
r2024.03.18-398
r2024.03.19-399
r2024.03.21-400
r2024.03.21-401
r2024.03.21-402
r2024.03.21-403
r2024.03.21-404
r2024.03.21-405
r2024.03.21-406
r2024.03.22-407
r2024.03.22-408
r2024.03.22-409
r2024.03.22-410
r2024.03.25-411
r2024.03.25-412
r2024.03.25-413
r2024.03.26-414
r2024.03.26-415
r2024.03.26-416
r2024.03.26-417
r2024.03.28-418
r2024.04.02-419
r2024.04.02-420
r2024.04.03-421
r2024.04.04-422
r2024.04.04-423
r2024.04.04-424
r2024.04.04-425
r2024.04.04-426
r2024.04.04-427
r2024.04.04-428
v1.0.0
v1.1.0
v1.1.1
v1.2-rc.0
v1.2-rc.1
v1.2.0
v1.3.0
v1.3.0-rc.0
v1.4.0
v1.4.0-rc.0
v1.4.1
v1.4.2
v1.4.3
v1.4.4
v1.5.0
v1.5.0-rc.1
v1.5.0-rc.2
v1.5.1
v2.0.0
v2.0.0-rc.0
v2.0.0-rc.1
v2.0.0-rc.2
v2.0.0-rc.3
v2.0.0-rc.4
v2.1.0-rc.0
${ noResults }
34 Commits (exclude-in-api)
| Author | SHA1 | Message | Date |
|---|---|---|---|
|
|
822483c37c
|
Extract Universal Analytics import logic (#3700)
* Move imported tables schemas to separate modules outside Google ns * Move buffer for imports to Imported ns * fix schema newlines * Extract UA import processing and persistence * Decouple analytics worker implementation from UA * Rename env variable for import buffer size * Preserve old import queue until release |
3 years ago |
|
|
f755b20569
|
Lock traffic notifications (#3641)
* Update communication * Remove an unreachable function (mistyped) * [migration] Make accept_traffic_until a date * Fix typo * Set `accept_traffic_until` when creating a site * Update sites `accept_traffic_until` on subscription change * Add a note to yearly cancellation notification * Rephrase annual e-mail for clarity * Pass the small build test * Add email notifications * Fixup * Implement `accept_traffic_until` notification worker * Fixup - no need to test this for small build * Update moduledoc * Move moduletag * s/sent_at/sent_on * Use WHERE NOT EXISTS instead of LEFT JOIN * Use upsert when tracking notifications sent * Store sent marker before actually sending notification * Prefer to keep `accept_traffic_until` on the user record This gives us a single source of truth, addresses cases like ownership transparently, simplifies the code and enables CRM toggles. The only downside is that there's another join performed in the Sites.Cache full refresh - in this case, small refreshes are skipped - but this is fine, since the traffic will be let in anyway. * Expose `accepted_traffic_until` in the CRM * Update lib/plausible/auth/user.ex Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com> * Preload owner in CRM * Use the offset parameter in trial over e-mail contents * Format * Harden cache test --------- Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com> |
3 years ago |
|
|
7bf1e2a6ed
|
Reapply "Define a better monthly pageview usage (#3564)" (#3574)
This reverts commit
|
3 years ago |
|
|
5278c23965
|
Revert and extract migration (#3573)
* Revert "Define a better monthly pageview usage (#3564)" This reverts commit |
3 years ago |
|
|
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 |
3 years ago |
|
|
a4b9c3b8ba
|
Remove custom domains support + update build options (#3559)
* Disable super-admin checks on small build * Mute a test writing to stdout * Move sampling outside of small build * Convert waiting_first_pageview to heex and stop relying on env vars * Set site limit unlimited on small build * Stop relying on app env to get trial expiry * Remove custom domains - including migration * Remove is_selfhosted from layout view * Quota fixup * Stop relying on app env for self hosted registration * Stop relying on app env for pass reset success * Apply on_trial? check only on full build * Update templates relying on app env * Adjusts auth controller tests for small build * Trial fixup * Fixup * Stop relying on app env * Rest of the fsckn owl * Update typespecs * Fix dialyzer warning * Remove unused module * Credo + format * GeoIP is not, for full build * Use `small_build?()` where applicable * Implement bypassing FirstLaunchPlug without insertions * Get Marko's patch |
3 years ago |
|
|
d66322e12d
|
Limit grandfathering to *active* subscribers and trials (#3524)
* refactor asserting plan generation in plans_test.exs * stop grandfathering old expired trials For users who registered before the business tiers release, we want to offer a chance to subscribe to a grandfathered plan. However, if they let their trial expire and don't subscribe in the next 10 days, they'll lose that opportunity. * stop grandfathering expired subscriptions * remove default title and icon from Generic.notice * fix bug with dismissable notice classList is null when dismissable_id is not given * alias Plausible.Auth.User * Refactor Generic.notice component Make it easy to apply different colors * move subscription_cancelled_notice across the app And remove from user settings > subscription box. Also, include a note about losing grandfathered status when letting the subscription expire. * allow full width in Generic.notice * use Generic.notice for subscription_past_due_notice * use Generic.notice for subscription_paused_notice * prevent two notices clashing into each other with gap-y-2 * define attrs for phx components * optimize for light mode * make subscription cancelled notice dismissable but if it's dismiss, show it in the place where it was before in the account settings > subscription box * make function private * replace function doc with regular comment to avoid compile warning * use array for classnames Co-authored-by: Vinicius Brasil <vini@hey.com> * fix typos in function doc --------- Co-authored-by: Vinicius Brasil <vini@hey.com> |
3 years ago |
|
|
f977351ae2
|
Fix upgrade page for legacy trials + bug fixes (#3486)
* allow using Stats API and Props for free_10k subscriptions * return v3 plans for legacy trials * do not display grandfathering notice for legacy trials * set a more accurate BT release date * fix bug on dev env Allow the `find/1` function to find sandbox plans * add error handling and tests for change_plan_preview * fix feature warning bug * fix credo warnings * fix tests * set BT release date further into the future * rename function and some vars * bugfix with limit exceeding * fix test |
3 years ago |
|
|
07cab27fef
|
Implement new sites view (#3463)
* Implement complete basics of LV sites
* Reimplement everything in LV except pagination
* Implement basic search capability
* PoC: plot visitors on sites index
* Add rudimentary clipped gradient in minicharts
* Fix clipping gradient, define once
* Format
* Add moduledoc to visitors component
* Move paginator helpers to the top core namespace
* Fix typespec of `Plausible.Sites.list`
* Split sites component into subcomponents
* Add function to uniformly calculate 24h intervals
and visitor totals across multiple sites.
* Integrate batch 24h interval query with plots on sites view
* Don't confuse heex compiler with alpine @ shorthands
* Make linear gradient svg definition truly invisible
* Implement basic pagination
* Extract `site_stats` from site and invitation cards
* Improve pagination
* Tweak css
* Improve filtering on pagination and make WSS fail graceful
* Test `last_24h_visitors_hourly_intervals/2`
* Replace /sites with LV implementation
* Add debounce to search filter
* Fix typespecs
* Fix styling
* Fix mini graph scaling factor calculation
* Fix search consuming itself
* Minimal tweaks to the plots
* Fixup
* Remove magic numbers from the plot
* Create `site_pins` table
* Add `SitePin` schema
* Implement listing invitations, sites and pins in a single query
* Add FIXME note
* Remove site pins for now
* Add tests for `Plausible.Sites.list/3`
* Add a couple more tests to sites dead view
* Remove unnecessary FIXME
* Add LV tests for Sites
* Calculate and display 24h visitors change
* Render the change in bold
* Add clarfying comment on virtual field in `Site` schema
* Remove unnecessary function from Invitations API
* Remove unused list opt from type definition in `Sites`
* Improve joins in list query slightly
* Add comment on manually computing sites list total
* Start searching from a singly character in domain field
* Add typespec to `last_24h_visitors_hourly_intervals`
* Extend moduledoc in visitors component
* Simplify loading sites in LV
* Simplify assigns in LV
* Add missing group for shadow under site card
* Make invitation modal render
* Make HTML in sites LV semantically correct
* Remove autofocus and focus search on `/`
* Remove shadow from search input
* Make search cancel on escape
* Fix tests relying on outdated HTML structure
* Make visitor chart color scheme consistent with dashboard chart
* Update styling of trend labels
* Fix empty state and improve search blur/focus handling
* Use live navigation for pagination
* Implement spinner on load from search
* Remove unused `Plausible.Stats.Clickhouse.last_24h_visitors/1`
* Calculate uniques correctly across hour boundaries
* Swap inlined svg for Heroicons component in invitation modal
* Add order by to base query in 24h hourly intervals
* Revert "Add order by to base query in 24h hourly intervals"
This reverts commit
|
3 years ago |
|
|
8cc7bce689
|
Restrict subscribing to a plan when exceeding its limits + warning for losing feature access (#3461)
* fix the styling of the red text notice under checkout link * avoid some code repetition * simplify rendering the change_plan_link * refactor disabling checkout link and showing disabled message * disable change plan and upgrade link when exceeding pageview limit * disable checkout when exceeding team member limit * disable checkout when site limit exceeded * extract checkout related code in a separate function * stick to a single order of features * losing features warning * fix back link from change-plan-preview * create Quota.exceeded_limits function * restrict subscribing with exceeded limits on the API level too * use with instead of case Co-authored-by: Vini Brasil <vini@hey.com> * use :map type instead of :any for user Co-authored-by: Vini Brasil <vini@hey.com> * create Quota.usage function --------- Co-authored-by: Vini Brasil <vini@hey.com> |
3 years ago |
|
|
51c1138d0d
|
Implement better user password validation (#3344)
* Add zxcvbn dependency * Change password length range requirement from 6-64 to 12-128 * Reimplement register form in LV * Implement server-side check for password strength * Add rudimentary strength meter * Make password input with strength a separate component and improve it * Fix existing tests to provide strong enough password * Apply formatting * Replace existing registration form with new one * Hide built-in label in `.input` component when none provided * Crop password to first 32 chars for analysis by zxcvbn * Add tests for new form components * Integrate hCaptcha into LV * Fix existing AuthController tests * Add tests for Live.RegisterForm * Hide strength meter when password input is empty * Randomize client IP in headers during tests to avoid hitting rate limit * Apply auxilliary formatting fixes to AuthController * Integrate registration from invitation into LV registration logic * Fix existing password set and reset forms * Make `password_length_hint` component more customizable * Optimize `Auth.User.set_password/2` * Remove unnecessary attribute from registration form * Move password set and reset forms to LV * Add tests for SetPasswordForm LV component * Add tests for password checks in `Auth.User` * Document code a bit * Implement simpler approach to hCaptcha integration * Update CHANGELOG.md * Improve consistency of color scheme * Introduce debounce across all text inputs in registration and password forms * Fix email input background in register form * Ensure only single error is rendered for empty password confirmation case * Remove `/password` form entirely in favor of preferred password reset * Remove unnecessary `router` option from `live_render` calls * Make expensive assigns in LV with `assign_new` (h/t @aerosol) * Accept passwords longer than 32 bytes uniformly as very strong * Avoid displaying blank error side by side with weak password error * Make register actions handle errors gracefully * Render only a single piece of feedback to reduce noise * Make register and password reset forms pw manager friendly (h/t @cnkk) * Move registration forms to live routes * Delete no longer used deadviews * Adjust registration form in accordance to changes in #3290 * Reintroduce dogfood page path for invitation form from #3290 * Use alternative approach to submitting plausible metrics from LV form * Rename metrics events and extend tests to account for them |
3 years ago |
|
|
928691158f
|
Fix test flakiness due to shared state in asynchronous run (#3184)
* Fix flaky test * Prevent this in the future |
3 years ago |
|
|
71ef0bd043
|
Clean up after V2 migration (#2868)
* Clean up after V2 migration This PR removes all the leftovers and alternative code branching after v2 migration. The self-hosted release is being drafted at: https://github.com/plausible/hosting/issues/68 Refs: - https://github.com/plausible/analytics/pull/2865 - https://github.com/plausible/analytics/pull/2825 - https://github.com/plausible/analytics/pull/2780 * !fixup |
4 years ago |
|
|
d2f2c69387
|
Conditionally support switching between v1 and v2 clickhouse schemas (#2780)
* Remove ClickhouseSetup module This has been an implicit point of contact to many tests. From now on the goal is for each test to maintain its own, isolated setup so that no accidental clashes and implicit assumptions are relied upon. * Implement v2 schema check An environment variable V2_MIGRATION_DONE acts like a feature flag, switching plausible from using old events/sessions schemas to v2 schemas introduced by NumericIDs migration. * Run both test suites sequentially While the code for v1 and v2 schemas must be kept still, we will from now on run tests against both code paths. Secondary test run will set V2_MIGRATION_DONE=1 variable, thus making all `Plausible.v2?()` checks return `true'. * Remove unused function This is a remnant from the short period when we would check for existing events before allowing creating a new site. * Update test setups/factories with v2 migration check * Make GateKeeper return site id along with :allow * Make Billing module check for v2 schema * Make ingestion aware of v2 schema * Disable site transfers for when v2 is live In a separate changeset we will implement simplified site transfer for when v2 migration is complete. The new transfer will only rename the site domain in postgres and keep track of the original site prior to the transfer so we keep an ingestion grace period until the customers redeploy their scripting. * Make Stats base queries aware of v2 schema switch * Update breakdown with v2 conditionals * Update pageview local start with v2 check * Update current visitoris with v2 check * Update stats controller with v2 checks * Update external controller with v2 checks * Update remaining tests with proper fixtures * Rewrite redundant assignment * Remove unused alias * Mute credo, this is not the right time * Add test_helper prompt * Fetch priv dir so it works with a release * Fetch distinct partitions only * Don't limit inspect output for partitions * Ensure SQL is printed to IO * Remove redundant domain fixture |
4 years ago |
|
|
6d79ca5093
|
Switch to new clickhouse adapter (ch/chto) (#2733)
* another clickhouse adapter * don't restore stats_removal.ex * fix events main-graph error (#2746) * update ch, chto * update chto again (#2759) * Stop treating page filter as an entry_page filter (#2752) * remove dead code * stop treating page filter as entry page filter in breakdown queries * stop treating page filter as entry page filter in aggregate queries * stop treating page filter as entry page filter in timeseries queries * mix format * update changelog * break code down to smaller functions to keep credo happy * remove unused functions * make CSV export return only conversions with goal filter (#2760) * make CSV export return only conversions with goal filter * update changelog * update elixir version in mix.exs (#2742) * revert admin.ex changes (#2776) --------- Co-authored-by: ruslandoga <67764432+ruslandoga@users.noreply.github.com> Co-authored-by: ruslandoga <rusl@n-do.ga> Co-authored-by: RobertJoonas <56999674+RobertJoonas@users.noreply.github.com> |
4 years ago |
|
|
8f86036e57
|
Keep track of native stats start timestamp when retrieving data (#2715)
* Stats boundary/PoC? * Delete stats removal * Drop events check on site creation * Update seeds script * Use native_stats_start_at * Don't rely on native stats pointer in imported stats queries * Reset site * Export reset/1 * Remove unnecessary inserted_at settings * Update seeds * Remove unnecessary inserted_at setting |
4 years ago |
|
|
8f85b110aa
|
Split Clickhouse pools into Read-Only and Read/Write (dedicated to writes) (#2661)
* Configure ingest repo access/pool size If I'm not mistaken 3 is a sane default, the only inserts we're doing are: - session buffer dump - events buffer dump - GA import dump And all are serializable within their scopes? * Add IngestRepo * Start IngestRepo * Use IngestRepo for inserts * Annotate ClickhouseRepo as read_only So no insert* functions are expanded * Update moduledoc * rename alias * Fix default env var value so it can be casted * Use IngestRepo for migrations * Set default ingest pool size from 3 to 5 in case conns are restarting or else... * Ensure all Repo prometheus metrics are collected |
4 years ago |
|
|
8f9f032968
|
Delay stats deletions (#2632)
* Implement Site removal transaction * Implement Stats removal Oban worker * Configure site removal queue * Call Site.Removal.run() instead of Purge.delete_site! * Test site/stats removal * Remove FIXME - filed a ticket * Over-communicate lenghty deletion process to the users |
4 years ago |
|
|
8bdbabbdad
|
Enable Dialyzer and Credo in CI (#2315) | 4 years ago |
|
|
0fa6b688af
|
Google APIs integration improvements (#2358)
* Make TestUtils module available in all tests * Add macros patching the application env in tests Unfortunately a lot of existing functionality relies on certain application env setup. This isn't ideal because the app config is a shared state that prevents us from running the tests in parallel. Those macros encapsulate setting up new env for test purposes and make sure the changes are reverted when the test finishes. * Allow passing request opts to HTTPClient.post/4 We need this to swap custom request building in Google Analytics import. * Unify errors when listing sites * React: propagate backend error messages if available * React: catch API errors in Search Terms component * Propagate google API errors on referrer drilldown * Handle verified properties errors in SC settings * Add missing tests for SC settings controller * Unify errors for fetching search analytics queries (list stats) * Unify errors refreshing Google Auth Token * Test fetch_stats/3 errors and replace Double with Mox * Fixup makrup * s/class/className * Simplify Search Terms display in case of errors * Fix warnings |
4 years ago |
|
|
c26e029d22
|
Increase flaky test timeout (#2330) | 4 years ago |
|
|
a10d44a0d7
|
Refactor event struct creation function (#2098)
* Replace Ingestion.Request headers with user_agent * Replace generic Ingestion.Request params with specific fields * Refactor event building function into small functions * Move Plausible.Ingestion to Plausible.Ingestion.Event * Add option to override event fields while building * Rename Ingestion.Request meta to props * Replace UTM-specific fields with generic query_params * Remove Map.from_struct/1 call from ingestion pipeline * Remove stash options from ingestion |
4 years ago |
|
|
3e5695408a
|
Use new Session.CacheStore in favour of Session.Store (#1934)
* Remove Session.Store in favour of Session.CacheStore * Add CHANGELOG entry * Use appropriate enum function |
5 years ago |
|
|
203f87520b
|
Ga import improvements (#1784)
* Do not link Google account for import * Record start date * Fix tests |
5 years ago |
|
|
e27734ed79
|
[Continued] Google Analytics import (#1753)
* Add has_imported_stats boolean to Site * Add Google Analytics import panel to general settings * Get GA profiles to display in import settings panel * Add import_from_google method as entrypoint to import data * Add imported_visitors table * Remove conflicting code from migration * Import visitors data into clickhouse database * Pass another dataset to main graph for rendering in red This adds another entry to the JSON data returned via the main graph API called `imported_plot`, which is similar to `plot` in form but will be completed with previously imported data. Currently it simply returns the values from `plot` / 2. The data is rendered in the main graph in red without fill, and without an indicator for the present. Rationale: imported data will not continue to grow so there is no projection forward, only backwards. * Hook imported GA data to dashboard timeseries plot * Add settings option to forget imported data * Import sources from google analytics * Merge imported sources when queried * Merge imported source data native data when querying sources * Start converting metrics to atoms so they can be subqueried This changes "visitors" and in some places "sources" to atoms. This does not change the behaviour of the functions - the tests all pass unchanged following this commit. This is necessary as joining subqueries requires that the keys in `select` statements be atoms and not strings. * Convery GA (direct) source to empty string * Import utm campaign and utm medium from GA * format * Import all data types from GA into new tables * Handle large amounts of more data more safely * Fix some mistakes in tables * Make GA requests in chunks of 5 queries * Only display imported timeseries when there is no filter * Correctly show last 30 minutes timeseries when 'realtime' * Add with_imported key to Query struct * Account for injected :is_not filter on sources from dashboard * Also add tentative imported_utm_sources table This needs a bit more work on the google import side, as GA do not report sources and utm sources as distinct things. * Return imported data to dashboard for rest of Sources panel This extends the merge_imported function definition for sources to utm_sources, utm_mediums and utm_campaigns too. This appears to be working on the DB side but something is incomplete on the client side. * Clear imported stats from all tables when requested * Merge entry pages and exit pages from imported data into unfiltered dashboard view This requires converting the `"visits"` and `"visit_duration"` metrics to atoms so that they can be used in ecto subqueries. * Display imported devices, browsers and OSs on dashboard * Display imported country data on dashboard * Add more metrics to entries/exits for modals * make sure data is returned via API with correct keys * Import regions and cities from GA * Capitalize device upon import to match native data * Leave query limits/offsets until after possibly joining with imported data * Also import timeOnPage and pageviews for pages from GA * imported_countries -> imported_locations * Get timeOnPage and pageviews for pages from GA These are needed for the pages modal, and for calculating exit rates for exit pages. * Add indicator to dashboard when imported data is being used * Don't show imported data as separately line on main graph * "bounce_rate" -> :bounce_rate, so it works in subqueries * Drop imported browser and OS versions These are not needed. * Toggle displaying imported data by clicking indicator * Parse referrers with RefInspector - Use 'ga:fullReferrer' instead of 'ga:source'. This provides the actual referrer host + path, whereas 'ga:source' includes utm_mediums and other values when relevant. - 'ga:fullReferror' does however include search engine names directly, so they are manually checked for as RefInspector won't pick up on these. * Keep imported data indicator on dashboard and strikethrough when hidden * Add unlink google button to import panel * Rename some GA browsers and OSes to plausible versions * Get main top pages and exit pages panels working correctly with imported data * mix format * Fetch time_on_pages for imported data when needed * entry pages need to fetch bounces from GA * "sample_percent" -> :sample_percent as only atoms can be used in subqueries * Calculate bounce_rate for joined native and imported data for top pages modal * Flip some query bindings around to be less misleading * Fixup entry page modal visit durations * mix format * Fetch bounces and visit_duration for sources from GA * add more source metrics used for data in modals * Make sources modals display correct values * imported_visitors: bounce_rate -> bounces, avg_visit_duration -> visit_duration * Merge imported data into aggregate stats * Reformat top graph side icons * Ensure sample_percent is yielded from aggregate data * filter event_props should be strings * Hide imported data from frontend when using filter * Fix existing tests * fix tests * Fix imported indicator appearing when filtering * comma needed, lost when rebasing * Import utm_terms and utm_content from GA * Merge imported utm_term and utm_content * Rename imported Countries data as Locations * Set imported city schema field to int * Remove utm_terms and utm_content when clearing imported * Clean locations import from Google Analytics - Country and region should be set to "" when GA provides "(not set)" - City should be set to 0 for "unknown", as we cannot reliably import city data from GA. * Display imported region and city in dashboard * os -> operating_system in some parts of code The inconsistency of using os in some places and operating_system in others causes trouble with subqueries and joins for the native and imported data, which would require additional logic to account for. The simplest solution is the just use a consistent word for all uses. This doesn't make any user-facing or database changes. * to_atom -> to_existing_atom * format * "events" metric -> :events * ignore imported data when "events" in metrics * update "bounce_rate" * atomise some more metrics from new city and region api * atomise some more metrics for email handlers * "conversion_rate" -> :conversion_rate during csv export * Move imported data stats code to own module * Move imported timeseries function to Stats.Imported * Use Timex.parse to import dates from GA * has_imported_stats -> imported_source * "time_on_page" -> :time_on_page * Convert imported GA data to UTC * Clean up GA request code a bit There was some weird logic here with two separate lists that really ought to be together, so this merges those. * Fail sooner if GA timezone can't be identified * Link imported tables to site by id * imported_utm_content -> imported_utm_contents * Imported GA from all of time * Reorganise GA data fetch logic - Fetch data from the start of time (2005) - Check whether no data was fetched, and if so, inform user and don't consider data to be imported. * Clarify removal of "visits" data when it isn't in metrics * Apply location filters from API This makes it consistent with the sources etc which filter out 'Direct / None' on the API side. These filters are used by both the native and imported data handling code, which would otherwise both duplicate the filters in their `where` clauses. * Do not use changeset for setting site.imported_source * Add all metrics to all dimensions * Run GA import in the background * Send email when GA import completes * Add handler to insert imported data into tests and imported_browsers_factory * Add remaining import data test factories * Add imported location data to test * Test main graph with imported data * Add imported data to operating systems tests * Add imported data to pages tests * Add imported data to entry pages tests * Add imported data to exit pages tests * Add imported data to devices tests * Add imported data to sources tests * Add imported data to UTM tests * Add new test module for the data import step * Test import of sources GA data * Test import of utm_mediums GA data * Test import of utm_campaigns GA data * Add tests for UTM terms * Add tests for UTM contents * Add test for importing pages and entry pages data from GA * Add test for importing exit page data * Fix module file name typo * Add test for importing location data from GA * Add test for importing devices data from GA * Add test for importing browsers data from GA * Add test for importing OS data from GA * Paginate GA requests to download all data * Bump clickhouse_ecto version * Move RefInspector wrapper function into module * Drop timezone transform on import * Order imported by side_id then date * More strings -> atoms Also changes a conditional to be a bit nicer * Remove parallelisation of data import * Split sources and UTM sources from fetched GA data GA has only a "source" dimension and no "UTM source" dimension. Instead it returns these combined. The logic herein to tease these apart is: 1. "(direct)" -> it's a direct source 2. if the source is a domain -> it's a source 3. "google" -> it's from adwords; let's make this a UTM source "adwords" 4. else -> just a UTM source * Keep prop names in queries as strings * fix typo * Fix import * Insert data to clickhouse in batches * Fix link when removing imported data * Merge source tables * Import hostname as well as pathname * Record start and end time of imported data * Track import progress * Fix month interval with imported data * Do not JOIN when imported date range has no overlap * Fix time on page using exits Co-authored-by: mcol <mcol@posteo.net> |
5 years ago |
|
|
7d1b1214e2 | Implement dashboard with new stats module | 5 years ago |
|
|
8a455dd191
|
Prevent user id collisions in session tracking (#744) | 6 years ago |
|
|
5acb5b7039
|
Stats API (#679)
* WIP * Add ability to filter by anything * Add API keys * Add version to api endpoint * Fix API test route * Fix API tests * Allow 'date' parameter in '6mo' and '12mo' * Rename session -> visit in API filters * Filter expressions in the API * Implement filters in aggregate call * Add `compare` option to aggregate call * Add way to manage API keys through the UI * Authenticate with API key * Use API key in tests |
6 years ago |
|
|
0a7684f3bc | Mix format | 6 years ago |
|
|
4b36bb7138
|
Use clickhouse_ecto for db connection (#317)
* Use clickhouse-ecto for stats * Use clickhouse ecto instead of low-level clickhousex * Remove defaults from event schema * Remove all references to Clickhousex * Document configuration change * Ensure createdb and migrations can be run in a release * Remove config added for debug * Update plausible_variables.sample.env |
6 years ago |
|
|
b4b7532f07
|
Formatting only changes - No code change (#75)
* first commit with test and compile job Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * adding 'prepare' stage Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * updated ci script to include "test" compile phase Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * adding environment variables for connecting to postgresql Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * updated ci config for postgres Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * using non-alpine version of elixir Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * re-using the 'compile' artifacts and added explict env variables for testing Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * removing redundant deps fetching from common code Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * formatting using mix.format -- beware no-code changes! Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * added release config Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * adding consistent env variable for Database Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * more cleaning up of environment variables Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * Adding releases config for enabling releases Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * cleaning up env configs Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * Cleaned up config and prepared config for releases Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * updated CI script with new config for test Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * Added Dockerfile for creating production docker image Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * Adding "docker" build job yay! Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * using non-slim version of debian and installing webpack Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * Adding overlays for migrations on releases Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * restricting the docker built to master branch only Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * typo fix Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * adding "Hosting.md" to explain hosting instructions Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * removed the default comments Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * Added documentation related to env variables * updated documentation and fixed typo Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * updated documentation * Bumping up elixir version as `overlays` are only supported in latest version read release notes: https://github.com/elixir-lang/elixir/releases/tag/v1.10.0 Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * Adding tarball assembly during release Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * updated HOSTING.md Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * Added support for db migration Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * minor corrections Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * initializing admin user Admin user has been added in the "migration" phase. A default user is automatically created in the process. One can provide the related env variables, else a new one will be automatically created for you. Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * Initial base domain update - phase#1 These changes are only meant for correct operating it under self-hosting. There are many other cosmetic changes, that require updates to email, site and other places where the original website and author is used. Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * Using dedicated config variable `base_domain` instead Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * adding base_domain to releases config Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * removing the dedicated config "base_domain", relying on endpoint host Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * Removed the usage of "Mix" in code! It is bad practice to use "mix" module inside the code as in actual release this module is unavailable. Replacing this with a config environment variable Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * Added support for SMTP via Bamboo Smtp Adapter Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * Capturing SMTP errors via Sentry Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * Minor updates Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * Adding junit formatter -- useful for generating test reports Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * adding documentation for default user * Resolve "Gitlab Adoption: Add supported services in "Security & Compliance"" * bumping up the debian version to fix issues fixing some vulnerabilities identified by the scanning tools * More updates for self-hosting Changes in most of the places to suit self-hosting. Although, there are some which have been left-off. Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * quick-dirty-fix! * bumping up the db connect timeout Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * bumping up the db connect timeout Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * bumping up the db connect timeout Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * bumping up timeout - skipping MRs :-/ * removing restrictions on watching for changes this stuff isn't working * Update HOSTING.md * renamed the module name * reverting formatting-whitespace changes Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * reverting the name to release Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * adding docker-compose.yml and related instructions Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * using `plausible_url` instead of assuming `https` this is because, it is much to test in local dev machines and in most cases there's already a layer above which is capable for `https` termination and http -> https upgrade Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * WIP: merging changes from upstream Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * wip: more changes * Pushing in changes from upstream Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * changes to ci for testing Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * cleaning up and finishing clickhouse integration Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * updating readme with hosting details * removing deleted files from upstream * minor config adjustments Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> * formatting changes Signed-off-by: Chandra Tungathurthi <tckb@tgrthi.me> |
7 years ago |
|
|
d1b703f007
|
Clickhouse (#63)
* Get stats from clickhosue * Pull stats from clickhouse * Use correct Query namespace * Use Clickhouse in unit tests * Use Clickhouse in stats controller tests * Use fixtures for unit tests * Add Clickhouse to travis * Use Clickhouse session store for sessions * Add garbage collection to session store * Reload session state from Clickhouse on server restart * Query from sessions table * Trap exits in event write buffer * Run hydration without starting the whole app * Make session length 30 minutes * Revert changes to fingerprint schema * Remove clickhouse from fingerprint sessions * Flush buffers before shutdown * Use old stats when merging * Remove old session schema * Fix tests with CH sessions * Add has_pageviews? to Stats |
7 years ago |
|
|
e8f20e67cc
|
React (#17)
* Load dashboard with react * Rename stast2 to dashboard * Save timeframe on the frontend * Implement current visitors * Implement comparisons * React to route changes * Add modals * Show number of visitors on hover * Show 'Today' for today * Add 30 days * Show referrer drilldown * Arrow keys to go back and forward * Improve comparisons UI * Fix dropdown when clicking on it * Verify API access in a memoized fashion * Test API access * Test stats through controller * Move map formatting from stats controller to stats * Remove unused code * Remove dead code from query * Remove dead code from stats templates * Add stats view test back in * Render modal inside the modal component * Implement google search terms * Add explanation for screen sizes * Separate dashboard JS from the app js |
7 years ago |
|
|
779d64e19a | Initial commit | 7 years ago |