Commit Graph

1083 Commits (457a5584712f67b12e4e81999757add0bc22ae21)

Author SHA1 Message Date
Adam Rutkowski 457a558471
Kick off sites by domain cache implementation (#2434)
* Implement sites by domain caching interface + warmer

* Add test

* Implement hit rate interface

* Add moduledocs

* Fix up typespec

* s/warmer/warmer_fn

* Extract measure_duration/2

* Fix up typespec

* Log errors and return nil on cache internal errors

* Fix up non-existing cache test

* Retrieve specific db columns when pre-filling the cache

* Reduce the subset of fields retrieved from the DB

See 63f3c6233d (r89871536)
4 years ago
Vini Brasil 9c98a3f2e8
Add API support for intervals (#2417) 4 years ago
RobertJoonas 47bf003c29
Merge pull request #2431 from plausible/fix-email-links
Fix email links
4 years ago
Robert 061d041213 small addition to spike_notification email 4 years ago
Robert f9fc0a741e use EmailView function for greeting user and change layout email signature 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
Robert 92df3b2577 do not use default layout in internal email 4 years ago
Robert 37c927287e speak on behalf of 'we' not 'I' 4 years ago
Robert d6125ffeb1 add tests for base_email template 4 years ago
Adam Rutkowski 6c7d2eb2b5
CRM: Expose rate limiting fields per site (#2429)
* Move schemas to paths corresponding to their namespace

* Include rate-limiting site schema fields

* Expose CRM RW access to site rate-limiting fields

* Remove 👾

* Add basic moduledoc placeholders
4 years ago
Robert 69f846fb07 do not use default layout in some emails 4 years ago
Robert ff16aa9df8 remove all repeated email footers 4 years ago
Robert eaf61ff170 set unsubscribe flags for unsubscribable emails 4 years ago
Robert a45580099d replace other salutation cases and make sure @user available in assigns 4 years ago
Robert 1d2a15ea28 remove user salutations by @user as done by the layout 4 years ago
Robert 31c8ebe842 add a default base_email layout to every email 4 years ago
Vinicius Brasil 042b448d30
Trace external HTTP requests (#2419)
This commit adds OTEL tracing to external HTTP requests made with
the HttpClient module. It records the elapsed time, host, path, and
response status code.
4 years ago
Uku Taht 8bdbabbdad
Enable Dialyzer and Credo in CI (#2315) 4 years ago
Conner Vieira 271704388a
Fixed a minor typo for consistency (#2420) 4 years ago
Adam Rutkowski 9364cebb4b
Fix up Cachex metrics (#2418)
* Fix cachex size metrics

* Collect Cachex hit ratio for UAs/Sessions

* Revert profiling metrics from 101e5a68
4 years ago
Robert fbe3a4e6f1 add a test and fix rendering the dashboard link 4 years ago
Marko Saric fc3be2a5b8
Update to keep the in-app footer consistent with the main site footer (#2413) 4 years ago
Adam Rutkowski 101e5a68b5
Allow Site DB lookups during ingestion phase (#2408)
* Implement FF-driven DB lookup for sites during ingestion

We like to see the impact of doing a simple postgres lookup on each
ingestion event. The percentage-based feature flag `:ingestion_pg_lookup`
must be set in order for lookups to be executed.

* Fix resolving Cachex stats metrics

* Enable PromEx on dev env
4 years ago
Vinicius Brasil 11d7cf01c9
Remove ingestion from OTEL tracing (#2409)
This commit removes the current 1% sampling on ingestion to completely
ignore ingestion traces. We are not getting enough value from those, and
we'll keep dashboard, API and background jobs traces only.
4 years ago
Marko Saric f9a2d00582
Changing the settings link in the renewal email (#2406)
Someone mentioned there's no way to cancel from the link we include in this email (https://plausible.io/billing/upgrade) so I'm changing it to the settings page instead https://plausible.io/settings. My own https://plausible.io/billing/upgrade is a bit different than normal subscribers see it so I don't actually know if there's a way to cancel on it. If there is a way there too, feel free to ignore this
4 years ago
Adam Rutkowski c604e49f4d
Update the snippet from js/plausible.js to js/script.js (#2395)
As per https://plausible.io/docs/plausible-script
4 years ago
Adam Rutkowski a44b8ff7f5
Improve test coverage (#2392)
Co-authored-by: ruslandoga <doga.ruslan@gmail.com>
4 years ago
Adam Rutkowski 6ba5e53574
Trim goals when creating and retrieving from the DB (#2382)
People are likely to enter (copy/paste) goals from external sources
which can lead to whitespace characters appended by accident.
That renders the goal unusable and hard to distinct visually.

Normally to fix up existing goals we would use a data migration,
but this should be good enough to check if the problem
with never appearing goals resurfaces.
4 years ago
Marko Saric 252cecbf25
Correct the spelling of JavaScript (#2380)
* Update README.md

* Update snippet.html.eex

* Update settings_general.html.eex

* Update site_controller_test.exs
4 years ago
Vinicius Brasil 73444ddfb6
Fix and test Google Analytics token refresh (#2381)
This commit fixes a bug where Google Analytics import tokens were not
being refreshed properly because the function was not returning the
expected tuple. Thanks to @aerosol we can nicely test this now.
4 years ago
Adam Rutkowski 8e75f2fc07
Separate GA/SC scopes (#2372)
* Use separate scopes for GA/SC integrations

* Update tests with google scope expectations
4 years ago
Adam Rutkowski d29597ed37
Fix random typos (#2375) 4 years ago
Vinicius Brasil c9945e09cf
Suggest enterprise plan when usage is greater than 10M pageviews (#2345) 4 years ago
Vinicius Brasil a86d9697ba
Clear stats_start_date after clearing GA stats (#2370)
This commit fixes a bug where users clearing one import and trying to
re-import would get invalid import date ranges. This was caused because
the stats_start_date field was not updated to nil after clearing
imported stats, as this field defines the end date of the import.
4 years ago
Vinicius Brasil b883d44697
Implement exponential backoff for GA requests (#2366)
This commit adds exponential backoff to GA request retries, increasing
the waiting time between requests.
4 years ago
Vinicius Brasil e48851a9ed
Skip rows with empty dates from GA imports (#2359) 4 years ago
Vinicius Brasil 9a61a10273
Do not report hard bounce e-mail errors to Sentry (#2361) 4 years ago
Adam Rutkowski 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
Vinicius Brasil 95aafb477d
Parse Google Analytics failed response before reporting to Sentry (#2354)
This commit parses failed GA responses to JSON before reporting to
Sentry. This makes Sentry's PII filtering smarter, redacting only
specific keys from the response, instead of the whole string.
4 years ago
RobertJoonas 409f1733ce
Optimize dark mode UI for shared link form (#2355)
* remove redundant empty div

* optimize shared link form for darkmode

* follow the same style in new_api_key form
4 years ago
RobertJoonas 54071fbc1b
Merge pull request #2348 from plausible/failed-ga-import-email
add debugging info to failed GA import email template
4 years ago
Robert f6593cef17 replace contact link with reply to this email 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
Marko Saric a68093b0b6
Adding LinkedIn to the in-app footer (#2347) 4 years ago
Robert cc8bed9c4a add debugging info to failed GA import email template 4 years ago
Adam Rutkowski e3ca3b32db
Include tests for Captcha success/failure scenarios (#2344)
* Include tests for Captcha success/failure scenarios

* DRY
4 years ago
Adam Rutkowski 28cec9d939
Automatically decode JSON payloads from HTTP (#2329) 4 years ago
Vinicius Brasil fb05e447f9
Increase Google Analytics timeout and lower page size (#2326)
The Google Analytics report request may take some time, especially with big
imports with thousands of pages. To mitigate the issue this commit increases
the timeout to 60s and lowers the page size to 7,500 records per request.
4 years ago
Adam Rutkowski ae4ae5d0a0
Handle duplicate invitations gracefully (#2323) 4 years ago
Adam Rutkowski ec90a264b4
Improve user input validation (#2291)
* Make pagination params parsing ignore bad input

* Remove unused binding

* Don't crash on filter parse error

* Sanitize input date on internal stats API

* Revert Query module changes (ref 55645734)

* Implement simplistic input date validation in stats controller

* Mute bad request logging
4 years ago