Commit Graph

1783 Commits

Author SHA1 Message Date
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.
2022-11-01 10:27:23 -03:00
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
2022-11-01 13:42:36 +02:00
Vinicius Brasil
90c78e8995
Move GA fixtures to fixtures/ folder (#2398)
This commit fixes up 29347126db871429d9e5c37c63c4f79.
2022-10-29 09:44:10 +02:00
Vinicius Brasil
b2047d8975
Show 0% difference instead of N/A (#2401)
Closes #2397
2022-10-28 11:21:07 -03:00
Adam Rutkowski
c604e49f4d
Update the snippet from js/plausible.js to js/script.js (#2395)
As per https://plausible.io/docs/plausible-script
2022-10-27 13:20:53 -03:00
RobertJoonas
7ccbc5d432
fix typos (#2393) 2022-10-27 08:57:34 +02:00
Adam Rutkowski
a44b8ff7f5
Improve test coverage (#2392)
Co-authored-by: ruslandoga <doga.ruslan@gmail.com>
2022-10-27 08:39:34 +02:00
dependabot[bot]
499b46f4c4
Bump bamboo_smtp from 4.1.0 to 4.2.2 (#2337)
Bumps [bamboo_smtp](https://github.com/fewlinesco/bamboo_smtp) from 4.1.0 to 4.2.2.
- [Release notes](https://github.com/fewlinesco/bamboo_smtp/releases)
- [Changelog](https://github.com/fewlinesco/bamboo_smtp/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fewlinesco/bamboo_smtp/compare/v4.1.0...v4.2.2)

---
updated-dependencies:
- dependency-name: bamboo_smtp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-26 17:59:36 -03:00
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.
2022-10-26 09:35:30 +02:00
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
2022-10-26 08:34:33 +02:00
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.
2022-10-26 07:43:49 +02:00
Adam Rutkowski
8e75f2fc07
Separate GA/SC scopes (#2372)
* Use separate scopes for GA/SC integrations

* Update tests with google scope expectations
2022-10-25 08:17:17 -03:00
Adam Rutkowski
d29597ed37
Fix random typos (#2375) 2022-10-25 08:17:09 -03:00
Vinicius Brasil
c9945e09cf
Suggest enterprise plan when usage is greater than 10M pageviews (#2345) 2022-10-25 13:16:44 +02:00
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.
2022-10-25 12:17:59 +02:00
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.
2022-10-25 12:17:19 +02:00
Adam Rutkowski
0c23e6ec57
Update Makefile with tracker generation (#2356) 2022-10-24 07:52:15 -03:00
Adam Rutkowski
3ddfda94a1
Fix up Purge tests (#2364) 2022-10-24 07:15:18 -03:00
Vinicius Brasil
e48851a9ed
Skip rows with empty dates from GA imports (#2359) 2022-10-24 07:13:52 -03:00
Vinicius Brasil
9a61a10273
Do not report hard bounce e-mail errors to Sentry (#2361) 2022-10-24 07:13:23 -03:00
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
2022-10-24 09:34:02 +02:00
Vinicius Brasil
93bb62ef27
Remove inserts per second Google Analytics test assertion (#2334)
This commit removes a flaky test assertion from the GA suite. The
initial purpose of this test was to ensure we are not inserting to
Clickhouse more than 1 time per second during an import.

Although it is nice to have an assertion like this, the test is flaky
and fails sometimes. To get the total inserts during a time range, it
queries Clickhouse internal tables for insert commands, and this number
is not deterministic.

In a real-world scenario with Clickhouse, the app runs in multiple nodes
not aware of their neighbors' CH calls. In that case, Grafana provides
us visibility over CH, and these tests do not suffice.
2022-10-20 10:26:40 -03:00
Vinicius Brasil
b898642373
Double maximum header length (#2353)
This commit makes the permitted header length more permissive, 8,192
bytes, doubling the Phoenix default.

Related to https://github.com/4lejandrito/next-plausible/issues/67
2022-10-19 09:41:05 -03:00
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.
2022-10-19 09:22:52 -03:00
ruslandoga
ad10721d46
add v prefix to version tags in public images (#2340) 2022-10-19 09:09:09 -03:00
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
2022-10-19 09:02:27 -03:00
RobertJoonas
54071fbc1b
Merge pull request #2348 from plausible/failed-ga-import-email
add debugging info to failed GA import email template
2022-10-18 19:54:16 +03:00
Robert
f6593cef17 replace contact link with reply to this email 2022-10-18 19:47:20 +03:00
ruslandoga
3db2b1cbd7
update clickhouse and postgres images in Makefile (#2343)
* update clickhouse and postgres images in Makefile

* update .PHONY
2022-10-18 17:13:59 +02:00
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.
2022-10-18 12:11:30 -03:00
Marko Saric
a68093b0b6
Adding LinkedIn to the in-app footer (#2347) 2022-10-18 16:09:07 +02:00
Robert
cc8bed9c4a add debugging info to failed GA import email template 2022-10-18 14:17:35 +03:00
Marko Saric
1dcfbf9f90
Adding LinkedIn 2022-10-18 08:12:18 +02:00
Adam Rutkowski
e3ca3b32db
Include tests for Captcha success/failure scenarios (#2344)
* Include tests for Captcha success/failure scenarios

* DRY
2022-10-17 08:16:59 -03:00
Adam Rutkowski
aa97e9cf89
Notify team on image build failures (#2331) 2022-10-13 11:41:05 -03:00
Vinicius Brasil
3c8b71ea3c
Revert "Bump hexpm/elixir (#2239)" (#2332)
This reverts commit 76806a8924.
2022-10-13 11:38:59 -03:00
Vinicius Brasil
c26e029d22
Increase flaky test timeout (#2330) 2022-10-13 14:56:25 +02:00
Adam Rutkowski
28cec9d939
Automatically decode JSON payloads from HTTP (#2329) 2022-10-13 09:39:15 -03:00
dependabot[bot]
735ef94397
Bump csv from 2.4.1 to 2.5.0 (#2328)
Bumps csv from 2.4.1 to 2.5.0.

---
updated-dependencies:
- dependency-name: csv
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-13 14:11:28 +02:00
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.
2022-10-13 14:10:00 +02:00
dependabot[bot]
76806a8924
Bump hexpm/elixir (#2239)
Bumps hexpm/elixir from 1.13.4-erlang-24.3.3-alpine-3.15.3 to 1.13.4-erlang-24.3.3-alpine-3.16.0.

---
updated-dependencies:
- dependency-name: hexpm/elixir
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-13 08:02:57 +02:00
dependabot[bot]
97f6332a79
Bump httpoison from 1.8.1 to 1.8.2 (#2307)
Bumps [httpoison](https://github.com/edgurgel/httpoison) from 1.8.1 to 1.8.2.
- [Release notes](https://github.com/edgurgel/httpoison/releases)
- [Commits](https://github.com/edgurgel/httpoison/compare/v1.8.1...v1.8.2)

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

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-13 08:02:14 +02:00
Adam Rutkowski
ae4ae5d0a0
Handle duplicate invitations gracefully (#2323) 2022-10-11 11:40:20 -03:00
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
2022-10-11 14:42:14 +02:00
RobertJoonas
38d5e00442
update contributing.md and makefile to install tracker deps (#2322) 2022-10-11 14:24:26 +02:00
Uku Taht
2c2f710d24 Push public image 2022-10-11 13:35:34 +02:00
RobertJoonas
c0da024b23
Remove static tracker files (#2116)
* remove tracker files from git index

* generate tracker files on npm test

* generate tracker files for elixir tests/dev/CI

* update tracker/package-lock.json

* exclude npm run deploy from mix test + some docs
2022-10-11 12:19:28 +02:00
Vinicius Brasil
8f6f860bd2
Add --host option to send_event task (#2320)
This commit adds an option to override `http://localhost:8000` in
`mix send_event`. This is useful when running the server in another port
or with remote servers such as staging.
2022-10-11 12:13:55 +02:00
Vinicius Brasil
0733efa89e
Delete stats improvements (#2318)
* Move clear stats functions to Plausible.Purge

* Delete both native and imported stats when deleting a site

This commit moves the delete site function to the Plausible.Purge
module, and fixes a bug where deleted sites could leave dangling
imported stats.

* Clear sites.stats_start_date after clearing stats

This commit fixes a bug where resetting stats left an invalid state of
the stats_start_date field, used for GA imports, for example.
2022-10-10 08:55:58 -03:00
Uku Taht
aadf892a71
Increase DB query timeout for site transfers (#2309) 2022-10-06 14:17:35 +03:00