Commit Graph

1031 Commits

Author SHA1 Message Date
RobertJoonas
8616dd46fb
added file-downloads script extension (#1775)
* added file-downloads script extension

* fixed the issues and made it compatible with IE

* changelog update
2022-03-31 13:52:09 +03:00
Uku Taht
8467979051 Add All Time option to datepicker 2022-03-31 11:00:20 +03:00
Uku Taht
18fd0dbe04 Always parse GA numbers as floats 2022-03-30 14:14:29 +03:00
Uku Taht
ed871e7a0b Parse scientific notation in GA import 2022-03-30 14:04:56 +03:00
Uku Taht
0ab8d653be Add retry mechanism to HTTPoison 2022-03-30 13:47:41 +03:00
Uku Taht
8719865a41 Redirect user when they've already upgraded 2022-03-30 10:10:44 +03:00
Uku Taht
ce649966ed Fix display 2022-03-29 13:38:35 +03:00
Uku Taht
ebdd856df7 Fix tests 2022-03-29 13:06:44 +03:00
Uku Taht
f00457c5d1 Change enterprise plans 2022-03-29 13:00:25 +03:00
Andrea Mazzarella
3c93a2d91b
1421 contains filter (#1799)
* small refactors and adds 'contains' to modal

* supports contains filter in the backend

* moves entry and exit page under the page filter

* prettier

* updates the CHANGELOG

* undo package-lock changes

* fixes formatting for elixir

* renames unused parameter to _

* Update changelog

* Use uppercase for constants and update type/prefix lookup
2022-03-29 08:39:16 +03:00
Uku Taht
c83e038af0 Add fallback if websiteUrl is not defined 2022-03-25 14:41:07 +02:00
Marko Saric
dce82833e9
changed url to ga import docs (#1796) 2022-03-25 14:03:53 +02:00
Uku Taht
ae78444830 Add notice about feature preview 2022-03-25 11:22:02 +02:00
Uku Taht
4cc4e0d61b Add config flag for import testers 2022-03-25 10:46:43 +02:00
RobertJoonas
e5cf800d4a
Improve stats api (#1759)
* can now query events metric when breaking down on a visit prop

* updated changelog

* fixed formatting

* fixed a bug - querying for bounce rate does not return visits anymore

* removed the changelog update
2022-03-24 16:16:51 +02:00
RobertJoonas
492f47ba1e
Crm transfer data (#1749)
* pull from master

* added query generation by struct fields

* ready, improved tests

* fixed a naming mistake
2022-03-24 16:11:04 +02:00
Uku Taht
5dc024a5cf Debug API call 2022-03-24 14:55:38 +02:00
Uku Taht
a375789f52 Deal with nil when importing 2022-03-24 14:35:08 +02:00
Uku Taht
3a0ec5481b Log import issue 2022-03-24 14:25:39 +02:00
Uku Taht
8aa38e146c Fix dark mode in settings general 2022-03-24 13:48:16 +02:00
Uku Taht
cd7c4bd724 Convert end_date timezone correctly 2022-03-24 13:34:22 +02:00
Uku Taht
1f32c6d8f0 Fix dark mode for GA import 2022-03-24 12:25:07 +02:00
Uku Taht
ad79678ed7 Add screen for user metric 2022-03-24 11:49:45 +02:00
Uku Taht
51cd24bcaf Allow user to cancel ongoing import 2022-03-23 11:58:36 +02:00
Uku Taht
0f58d56c11 Get real start date for date range 2022-03-23 11:19:34 +02:00
Uku Taht
445b8c5d43 Show real view ID 2022-03-23 10:48:47 +02:00
Uku Taht
203f87520b
Ga import improvements (#1784)
* Do not link Google account for import

* Record start date

* Fix tests
2022-03-22 16:09:45 +02:00
Uku Taht
ea947a1401 Increase HTTP timeout 2022-03-22 12:13:15 +02:00
Uku Taht
f42b694f15 Send import failed email when job errors 2022-03-22 12:01:39 +02:00
Uku Taht
1fb39957a6 Import Oban error handling 2022-03-21 14:24:45 +02:00
Uku Taht
83df555f55 Remove OTEL 2022-03-21 12:59:14 +02:00
Uku Taht
e1d6d119b0 Add end date to GA import 2022-03-21 12:47:27 +02:00
Uku Taht
c4f7c9a7a0 Add debug loggin to GA import 2022-03-17 11:56:32 +00:00
Uku Taht
dd01d79f32 Update google branding 2022-03-16 11:24:39 +00:00
Uku Taht
e026148fb0 Show better error message on duplicate domain
Co-authored-by: Marko Saric <me@markosaric.com>
2022-03-10 15:11:19 -06:00
Uku Taht
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>
2022-03-10 15:04:59 -06:00
RobertJoonas
b4992cedc1
Referrer spam blocklist (#1750)
* integrating blocklist library

* loads blocklist dependency from Github
2022-03-10 13:58:30 -06:00
Marko Saric
3ae2adc583
Use the correct email address for password reset (#1738) 2022-03-08 13:05:19 -06:00
Uku Taht
6bd4b73a91 Add clause for missing date 2022-02-28 15:44:02 -06:00
Uku Taht
8fa1d60ff0 Send cancellation email safely 2022-02-28 15:34:00 -06:00
RobertJoonas
775ae6228f
Streamlining support (#1723)
* can now remove user grace period from crm

* added a created_at column to users and sites in crm
2022-02-28 15:15:37 -06:00
Marko Saric
c12346b6bf
Add a note to invite team members (#1715) 2022-02-25 10:26:13 -06:00
RobertJoonas
6b22806e1f
Allow admin access to locked dashboards (#1710)
* added super-admin access to locked dashboards

* fixed formatting
2022-02-23 13:48:33 -06:00
Uku Taht
c2440dd96a Update tracking 2022-02-23 10:21:44 -06:00
RobertJoonas
5ef7baab70
removed a space from 6 mailto links (#1691) 2022-02-23 08:59:43 -06:00
Uku Taht
b0b9b9212b Fixes password authentication issue with shared links 2022-02-22 13:46:57 -06:00
bytecode1024
d947d761a5
Fix upper limit of range A-Z (#1668)
Since the A-z range includes [, \, ], ^, _, and `, I assume this is a typo on the upper limit of the A-Z range.
2022-02-17 10:24:49 -06:00
Uku Taht
5b893bde39 Revert "Include 0 length pageviews in time_on_page calculation"
This reverts commit cee79e7875.
2022-02-10 14:03:56 -06:00
Uku Taht
cee79e7875 Include 0 length pageviews in time_on_page calculation 2022-02-09 16:53:05 -06:00
Ralf Zimmermann
408d95fe09
Add custom goal props to breakdown endpoint (#1578) 2022-02-01 10:09:45 -06:00
RobertJoonas
78dbdfc092
Fix broken docs link in welcome email (#1646) 2022-01-28 17:31:14 -06:00
Uku Taht
d1fe1f7e41 Cache the tracking script for 24 hours 2022-01-24 16:01:30 -06:00
Uku Taht
0505de9b42 Add site limit to enterprise upgrade plan 2022-01-24 15:08:13 -06:00
Uku Taht
52067803df Update session stats from event 2022-01-21 14:48:26 -06:00
ssendev
8077671f8a
Update session screen_size if unknown (#1610) 2022-01-21 14:32:19 -06:00
Uku Taht
0a5f6c5886 Implement wildcard filters for the API 2022-01-21 11:49:23 -06:00
Uku Taht
ebb9476b56 Fix visit duration stat 2022-01-21 11:16:15 -06:00
Marko Saric
5bdd74a524
Some changes for the Netherlands (#1607) 2022-01-20 09:55:03 -06:00
Marko Saric
3e1a7a10bb
Some fixes for Austria (#1608) 2022-01-20 09:54:27 -06:00
Uku Taht
5344c477f3 Mix format 2022-01-20 09:53:07 -06:00
Uku Taht
19f1b03043 Deliver password reset email asynchronously
Fixes a potential timing attack where someone could find out
whether an email address is in our database or not.
2022-01-20 09:51:42 -06:00
Marko Saric
1f29d9d358
Change for Norway (#1618) 2022-01-19 09:44:57 -06:00
Marko Saric
cc88526777
fixes for Zürich (#1612) 2022-01-19 09:38:09 -06:00
Uku Taht
6e21f28980 Access region safely 2022-01-18 11:13:35 -06:00
Uku Taht
febfaa44e0 Dont error with unknown country 2022-01-18 10:41:15 -06:00
Uku Taht
cd40579740 Ignore unknown country code 2022-01-18 10:23:26 -06:00
Uku Taht
81eb2b73df Notify Sentry when location code is not found 2022-01-18 10:04:13 -06:00
Uku Taht
381c7ac7bc Update domain 2022-01-15 11:41:20 -06:00
Uku Taht
23605c3d44 Add task for plans 2022-01-15 09:07:59 -06:00
Uku Taht
e7f13f7d70 Remove debug statement 2022-01-15 09:05:50 -06:00
Uku Taht
35ee2fe3fb Parse bunny header 2022-01-15 08:57:25 -06:00
Uku Taht
3fb184a893 Log IP for testing 2022-01-14 18:10:58 -06:00
Uku Taht
f049e7f358 Fix plan 2022-01-14 18:10:28 -06:00
Uku Taht
3f5151585a Mix format 2022-01-12 11:40:53 -06:00
Marko Saric
8673fc29e0
Couple of changes to the cities (#1599)
* Couple of changes to the cities

- list of city overrides now alphabetical
- added new overrides for switzerland and canada

* Changes for Bucharest
2022-01-12 17:34:29 +00:00
Uku Taht
9a7d1dd686 Adjust dashboard locked copy 2022-01-12 16:59:52 +00:00
Uku Taht
ecc233443e Remove duplicate entry from cities map 2022-01-06 17:28:43 +02:00
Uku Taht
6f4d5b7b8c mix format 2022-01-06 17:24:59 +02:00
Marko Saric
73579054a8
Merge the two Bratislavas (#1587)
* Update settings_email_reports.html.eex

* fixed two typos

upgrage = upgrade
tranfer = transfer

* change sites to stats

changing sites to stats as couple of people mentioned it sounds like we will lock their websites so nobody can visit them

* Change from 14 to 45 times smaller

* Merge the two Bratislavas

* Some fixes to Denmark
2022-01-06 15:56:33 +02:00
Matt Colligan
8148d41e42
Add cities and regions to exported CSV data (#1485) 2022-01-04 11:08:06 +02:00
Marko Saric
1ab28875c3
change sites to stats (#1576)
* Update settings_email_reports.html.eex

* fixed two typos

upgrage = upgrade
tranfer = transfer

* change sites to stats

changing sites to stats as couple of people mentioned it sounds like we will lock their websites so nobody can visit them

* Change from 14 to 45 times smaller
2022-01-04 11:06:08 +02:00
Uku Taht
50df61cefa Add v3 plans to all_plans 2022-01-03 17:27:35 +02:00
Uku Taht
f1e6baa9df Better sentry error 2022-01-03 17:21:03 +02:00
Uku Taht
0b253421ce Fix tests 2022-01-03 11:34:59 +02:00
Uku Taht
9a77644517 Better sentry message when plan is not found 2022-01-03 11:16:48 +02:00
Uku Taht
880ea45cd9 Remove cities feature flag 2021-12-31 12:16:25 +02:00
Uku Taht
d4e7d27df6 Merge branch 'new-plans' 2021-12-30 11:09:13 +02:00
Uku Taht
28ab506bb8 Set start time for v3 pricing 2021-12-30 11:08:44 +02:00
Uku Taht
f5fee73363 Add city overrides for mexico city 2021-12-30 10:46:05 +02:00
Uku Taht
1bef6fda52 Add stockholm override 2021-12-29 16:00:17 +02:00
Uku Taht
3fffd0c05d Add city overrides 2021-12-29 15:29:13 +02:00
Uku Taht
0bf1da09ce New plans 2021-12-28 12:26:53 +02:00
Uku Taht
303533af60 Use new testing subfolder 2021-12-23 10:32:22 +02:00
Marko Saric
7fc53124d8
Fixed two typos (#1555)
* Update settings_email_reports.html.eex

* fixed two typos

upgrage = upgrade
tranfer = transfer
2021-12-22 09:49:12 +02:00
Uku Taht
b5047edc22 Truncate domain name 2021-12-20 16:07:25 +02:00
Uku Taht
711cbdfca2 Remove unused custom domain code 2021-12-20 11:49:50 +02:00
Uku Taht
051294445a Always show settings cog 2021-12-20 11:39:55 +02:00
Uku Taht
f34c90e26c Show UTM term and content 2021-12-17 16:00:06 +02:00
Uku Taht
4d97583331 Use safe email functions
Fixes #1545
2021-12-17 11:16:18 +02:00
Uku Taht
d48eafc436 Temporarily disable utm_term and content from csv export 2021-12-16 15:59:29 +02:00
Uku Taht
4ea0e29620 Add UTM content and term to CSV export 2021-12-16 15:50:37 +02:00
Uku Taht
48ad7485c8
PR 1393 continued (#1542)
* Add `utm_content` and `utm_term`.
Support `utm_content` and `utm_term` as requested in #515.

* Add dropdown for UTM options

* Remove utm_content and term from filter modal for now

Co-authored-by: Blender Defender <defenderblender@gmail.com>
2021-12-16 11:02:09 +02:00
RobertJoonas
231c72e8e8
add vs cloudflare link to page footer 2021-12-15 16:44:06 +02:00
Uku Taht
dc8d20496c Show locked message in shared link 2021-12-14 12:10:34 +02:00
Ralf Zimmermann
faf4459b15
Add "events" metrics to public breakdown endpoint (#1529) 2021-12-14 11:41:33 +02:00
Uku Taht
66575f497b Add goal type to JSON response 2021-12-14 11:39:26 +02:00
Uku Taht
97cdc4814e Refactor goals API 2021-12-13 15:23:47 +02:00
Uku Taht
1dba113e2f
[Draft] Improve location translations (#1526)
* WIP

* Use location library for search suggestions

* Remove unused code

* Remove Countries completely

* Fix tests
2021-12-13 12:03:27 +02:00
Uku Taht
b49fd19934
Pull 1506 - formatted (#1527)
* adding api route PUT /api/v1/sites/goals with form fields "goal_type" and "goal_value" with supported types "event" and "page"

* arm64 docker images

* adding api route DELETE /api/v1/sites/goals/:goal_id with form param "site_id"

* revert makfile + package.json

* return statement hotfix in case site could not be found

* adding api route PUT /api/v1/sites/goals/:goal_id with form params "site_id", "goal_type", and "goal_value"

* update the goal api routes to accept event_name or page_path instead of goal_value

* cleaning goals model

* mix format

Co-authored-by: Ahmed Abbas <a.abbas@ixdc.net>
2021-12-09 16:08:01 +02:00
Uku Taht
442e401ede Use new location library 2021-12-09 16:02:11 +02:00
RobertJoonas
9022234aa6
added invoices section (#1511)
* added invoices section

* fixed formatting

* UI and code style improvements, paddle sandbox setup only on dev environment (fixed)
2021-12-09 15:49:57 +02:00
Uku Taht
139adc4056 Add more mobile browser rules 2021-12-09 11:49:37 +02:00
Uku Taht
a2d0244315 Fix site locked email 2021-12-06 14:22:46 +02:00
Uku Taht
1bc9f6bfb5 Remove more dead code 2021-12-03 11:21:33 +02:00
Uku Taht
01706b7590 Remove dead code 2021-12-03 11:19:39 +02:00
Uku Taht
4d0bc61ffd Remove Twitter stuff 2021-12-02 11:53:29 +02:00
Uku Taht
e7e36b994d Skip usage checking for users who are on grace period 2021-12-02 11:42:34 +02:00
Uku Taht
effe56b3e4 Use new iso_codes package 2021-12-01 15:31:50 +02:00
Ru Singh
17563e99c5
UI fix: footer alignment on mobile (#1498)
* fix(ui): footer alignment on mobile

* docs(changelog): new entry for footer alignment
2021-11-30 13:06:58 +02:00
Uku Taht
7cfd9f95f1 Delete a site through the API 2021-11-30 11:22:15 +02:00
Uku Taht
07af25ffc3 Fix subscription_interval for enterprise plans 2021-11-29 12:16:51 +02:00
Uku Taht
9c07cf7ea6 Report allowance issues to Sentry 2021-11-29 12:04:02 +02:00
Uku Taht
2463296403 Fetch enterprise plan corretly 2021-11-29 11:52:17 +02:00
Uku Taht
b695732521 Improve scroll behaviour on the dashboard 2021-11-26 16:00:34 +02:00
Uku Taht
37d3f2e36e Make sure that deleting an account also deletes stats 2021-11-26 15:39:42 +02:00
Uku Taht
5f6553c8d8 Remove DDG 2021-11-26 11:59:04 +02:00
Uku Taht
6fc0e7ba92 Use payment error 2021-11-26 11:53:23 +02:00
Uku Taht
7e93500834 Allow admins to access the stats API 2021-11-25 15:32:01 +02:00
Uku Taht
2bdfec1cc0
JS refactor: use generic ListReport for country report (#1487)
* Use ListReport for countries

* Fix countries tests

* Replace Browsers with ListReport

* Use Listreport for OS and screen size
2021-11-25 12:00:17 +02:00
Uku Taht
dae99a94b2 Add note about embedded dashboard password protection 2021-11-25 10:50:13 +02:00
Uku Taht
6aa0d7405d Sample to 20m instead of 10m 2021-11-24 11:16:32 +02:00
Marko Saric
aa5add2142
Update settings_email_reports.html.eex (#1486) 2021-11-24 10:47:53 +02:00
Uku Taht
05bf43c1be
City level location data (#1449)
* Merge branch 'plausible_master'

* Add City level details

* Add City level details

* Use ISO codes instead of geoname_id for subdivisions

* Add easier way to configure geolocation database

* Add workflow for dev branch

* Correct clickhouse migration

* Translate subdivision names

* Translate city names

* WIP

* Region and country filters

* Fix region filter

* Remove region_name when removing region filter

* Add modals for regions and cities

* Remove dead code

* WIP

* Revert "WIP"

This reverts commit 3202bf2fe9.

* Feature flag to hide cities when deployed

* Add changelog entry

* Remove unused code

* Remove unused variables

* Fix test

Co-authored-by: AymanTerra <aymanterra@yahoo.com>
2021-11-23 11:39:09 +02:00
Uku Taht
06d0d0eafa Fix over limit email reccommendation 2021-11-23 11:21:55 +02:00
Uku Taht
941a91ec22 Make better use of the index on sessions table 2021-11-22 10:58:44 +02:00
Uku Taht
218f1158d6 Show visitor counts in Search Console report
Fixes #1480
2021-11-22 10:49:15 +02:00
Uku Taht
e355828465 Remove pageview filter by default 2021-11-22 10:42:51 +02:00
Uku Taht
a3aede73f9 Let staging track itself 2021-11-18 11:18:04 +02:00
Uku Taht
6b55ace014 Fix error with JSON parsing 2021-11-18 10:36:16 +02:00
Uku Taht
0edf4765d4 Ignore maps in prop values 2021-11-18 10:28:20 +02:00
Uku Taht
373d05e8de Fix error with anonymous users on shared links 2021-11-16 10:24:47 +02:00
Uku Taht
d3311898c5 Show message when grace period is over 2021-11-16 10:14:24 +02:00
Uku Taht
e9cb8eb4e2 Remove grace period if user upgrades 2021-11-16 10:14:24 +02:00
Uku Taht
ec2a4a1a65 Add [Action required] to over limit email 2021-11-16 10:14:24 +02:00
Uku Taht
d547d0f996 Send email notification when sites are locked at grace period end 2021-11-16 10:14:23 +02:00
Uku Taht
29cb7462e6 Add grace period to upgrade 2021-11-16 10:14:23 +02:00
Uku Taht
f88956ef3c Fix compiler warning 2021-11-15 17:13:37 +02:00
Uku Taht
c4dcd87c08 Export fixes 2021-11-15 17:06:39 +02:00
Matt Colligan
7faa2f6673
CSV export output conversions and conversion rate when filtering for goal (#1464)
* Only add percentages to dashboard data when not filtering goal

* Correctly name CSV headers when exporting conversion data

* Remove percentages from tests when filtering for goal
2021-11-12 15:18:35 +02:00
Matt Colligan
3380685d40
Fix custom property total conversions value not displayed & Export custom properties (#1456)
* Fix custom property total conversions value not displayed

The custom property conversion metrics are not consistent with the other
metrics resulting in the total conversions not being displayed in the
dashboard. This fixes that.

* Export custom props of current goal when filtering dashboard for goal

This makes the CSV export also output a `prop_breakdown.csv` file which,
for the currently filtered goal, contains the conversion data for each
of its configured properties.

* Add test for goal-filtered CSV export
2021-11-10 16:53:38 +02:00
Uku Taht
7a02aae2a5 Accept custom props in expected format 2021-11-10 15:51:43 +02:00
Matt Colligan
d781301886 Apply existing filter to visitors.csv in export (#1454)
Also adds a test to ensure the filter always applies.
2021-11-09 14:51:10 +02:00
Uku Taht
c9f68248d8 Fix error with conversion rate 2021-11-09 11:51:50 +02:00
Matt Colligan
29e37c8342 More improvements for CSV export (#1446)
* Round time_on_page metric returned by 'pages' API

This rounds the `time_on_page` metric returned as part of the `pages`
API to the nearest second. While this shows no apparent change in the
web UI, it removes the decimal from the exported data in `pages.csv`.

* Tidy up export tests

* Round time_on_page in db query

* Add goal to CSV export tests

* Display CSV export spinner until download is ready

The mechanism used to make the page aware that the download is ready is:

- Client code sets a cookie and requests download.
- Server code handles download and removes cookie when complete.
- Client code polls every 1s to check the cookies, removing spinner when
  the export cookie is removed.
2021-11-09 09:51:38 +02:00
Uku Taht
5c02811d26 Add opentelemetry oban 2021-11-09 09:42:47 +02:00
Uku Taht
42d70bf4ea Optimization: only request top sources if notification is to be sent 2021-11-08 15:39:17 +02:00
Matt Colligan
945bf82c72
Fix conversions metrics (#1447)
f576fa2 should have updated the conversion metric names so that
`unique_conversions` and `total_conversions` are the two metrics
returned by the conversions API. This updates those so that the CSV
export outputs the correct data.
2021-11-05 15:18:59 +02:00
Uku Taht
76f6a00bec Add honeycomb 2021-11-05 14:58:57 +02:00
Matt Colligan
f576fa2a2c
Improvements to CSV export (#1427)
* Add details=True to export API parameters

This makes the ZIP export add `%{"details" => "True"}` to the query's
`params` when fetching data internally for packaging in the ZIP.

This adds bounce_rate and time_on_page to the data in pages.csv, and
bounce_rate and visit_duration to sources.csv.

* Make API return data with consistent names

Some of the data types returned via the JSON or CSV API use inconsistent
naming, and some have redundant name changes (i.e. count -> visitors ->
count). This makes these all consistent and removes the redundancy.

This addresses #1426, fixes some of the CSV headers, and unifies the
JSON and CSV return data labels.

* Update changelog

* Test should use Timex.shift, not relative time

* Return full country names in CSV export

This also replaces the " character with ' in two country names, as those
are the characters used in the names, yielding a more predictable and
'correct' output.

* Fetch CSV exported data concurrently

* Use spinner to indicate when export has started

* Use 300 as default number of brekadown entries for export

Higher numbers (e.g. 1000) seem to cause clickhouse errors when there
many pages to request. It is unclear what is causing the error, as
clickhouse returns an "unknown" error code and an empty error message.
2021-11-04 14:20:39 +02:00
Uku Taht
7364733faf Ensure that question marks are encoded properly for the database 2021-10-28 13:46:45 +02:00
Uku Taht
9aa466b23f Remove unused mix task 2021-10-28 12:56:06 +02:00
Uku Taht
dc080e9aa3 Remove bad EEX tag 2021-10-27 14:28:05 +02:00
Uku Taht
6f842b5603 Add better copy to locked page 2021-10-27 11:38:50 +02:00
Matt Colligan
8138a6e3a5
Start putting together means to export all aggregate data (#1387)
* Export all dashboard data in zip

This packages all data currently visible in the dashboard into
individual CSVs and downloads them together in a zip.

* Also export conversions in zip of CSVs

* Update export test with zip file response

* Add zip file download to changelog
2021-10-26 15:54:50 +02:00
Uku Taht
1b0323f5c1 Use more path helpers 2021-10-26 10:59:14 +02:00
Uku Taht
a22bc91429 Add rel="noreferrer" to links from self-hosted to our site 2021-10-26 10:26:43 +02:00
Uku Taht
e4bcdfa474 Revert "Get fresh search console data"
This reverts commit 3ab19afea5.
2021-10-25 12:00:46 +02:00
Uku Taht
3ab19afea5 Get fresh search console data 2021-10-25 11:46:23 +02:00
Uku Taht
9edbbe805d Update dependencies 2021-10-25 11:16:56 +02:00
Uku Taht
83b646eaea Do not send slack message on self hosted 2021-10-25 10:05:57 +02:00
Uku Taht
710f6f568a Ignores invalid query param part 2021-10-25 10:02:38 +02:00
Uku Taht
6dd9b0bb2f Do not error when bad custom prop value is supplied 2021-10-22 15:48:59 +02:00
Uku Taht
00184ce8ab Remove page from plausible tracking 2021-10-22 15:33:34 +02:00
Uku Taht
f13962b387 Remove page from Plausible tracking 2021-10-22 15:31:31 +02:00
Uku Taht
4ee6257fcd Preload when needed 2021-10-22 14:23:38 +02:00
Uku Taht
b9b37cdd34 Show pricing v2 when appropriate 2021-10-22 14:15:43 +02:00
Uku Taht
4eae40cd71 Apply usage optimization in background job 2021-10-22 12:20:11 +02:00
Uku Taht
26e34596c8 Allow enterprise plan users to create sites 2021-10-22 11:38:47 +02:00
Uku Taht
e66e9bd1b7 Check site limit for enterprise customers 2021-10-22 11:26:07 +02:00
Uku Taht
792e534edd Optimize usage calculation for large accounts 2021-10-22 10:42:27 +02:00
Uku Taht
b1594c631e Adjust API key limits for enterprise plans 2021-10-21 11:02:45 +02:00
Uku Taht
cc4966a1c3 Change default API limit to 600 2021-10-21 10:43:42 +02:00
Uku Taht
6a5b383e2b Add enterprise plans 2021-10-20 16:49:11 +02:00
Uku Taht
950bd012d5 Simplify geolix database config 2021-10-18 15:49:55 +02:00
Uku Taht
2ca3baeafd Disable email verification by default 2021-10-18 12:01:54 +02:00
Uku Taht
f77c37800f Use safe version of Cachex.fetch
Fixes #905
2021-10-18 11:27:52 +02:00
Vignesh Joglekar
0c982a8670
Adds list-based country report option (#1381)
* Adds list option for countries report

* Changelog

* Renames Geo to Locations

* Lint

Co-authored-by: Uku Taht <Uku.taht@gmail.com>
2021-10-14 10:55:43 +02:00
Vignesh Joglekar
7e9d83d62e
Adds pagination for custom props & fixes an issue with errant (none) return values (#1382)
* Adds pagination for custom props, fixes errant (none) being returned in the middle of a dataset

* Formatting

* Fixes errant (none) value correctly

* Changelog

* Adds tests
2021-10-14 09:45:47 +02:00
Vignesh Joglekar
f56992532f
Changes support links in self-host setup to links to GH Discussions (#1368)
* Swaps issue template to new issue form syntax

* Indentation update

* Indentation update?

* More indentation

* Intendation is hard

* Finalized indentation?

* Github indentation

* Missing fields

* Formatting changes

* Checkbox changes

* Swaps support lines in selfhost environment
2021-10-12 15:53:13 +02:00
Vignesh Joglekar
b4445b1f7c
Adds various dark mode missing styles (#1367)
* Swaps issue template to new issue form syntax

* Indentation update

* Indentation update?

* More indentation

* Intendation is hard

* Finalized indentation?

* Github indentation

* Missing fields

* Formatting changes

* Checkbox changes

* Fixes various dark mode issues

* Couple more dark mode issues
2021-10-12 11:50:24 +02:00
Uku Taht
e6b8a6a623 Remove unnecessary z-index 2021-10-12 11:33:17 +02:00
Felix Haase
d3187e54e3
Fix z-indexes that cause menu overlay (#1365)
fixes #1352
2021-10-12 11:31:46 +02:00
Uku Taht
2e6f13ba67 Make sure ownership transfer sets trial_expiry_date 2021-10-12 10:28:32 +02:00
Uku Taht
cd68761928 Fix utm_sources when filtering by event:page 2021-10-11 12:16:00 +02:00
Uku Taht
23a4f37ab4 Add 'manual' script variant 2021-10-10 13:07:37 +02:00
Uku Taht
a7fd23a804 Revert "Reduce database roundtrips on critical path for authorization"
This reverts commit 71d1988ee8.
2021-09-30 09:45:58 +02:00
Uku Taht
015dcfa051 HOTFIX: add domain blacklist 2021-09-30 09:45:52 +02:00
Uku Taht
bd7de59a9c Show total visitors when filtered for goal 2021-09-29 13:28:29 +02:00
Uku Taht
71d1988ee8 Reduce database roundtrips on critical path for authorization 2021-09-24 23:04:26 +02:00
Uku Taht
a722d02e63 Return 400 when domain is missing 2021-09-24 13:28:10 +02:00