Commit Graph

1175 Commits (jsx-conditional-rendering)

Author SHA1 Message Date
Vinicius Brasil 4d20c7ce70
Catch Google Search Console grant error (#2101)
* Remove invalid Jason.decode argument

Co-authored-by: Robert Joonas <robertjoonas16@gmail.com>

* Add custom message to Google invalid grant error

Co-authored-by: Robert Joonas <robertjoonas16@gmail.com>

* Test invalid_grant while refreshing Google token

Co-authored-by: Robert Joonas <robertjoonas16@gmail.com>

Co-authored-by: Robert Joonas <robertjoonas16@gmail.com>
4 years ago
RobertJoonas 8595332717
Merge pull request #2105 from renbaoshuo/update-links-to-docs
Update links to documents
4 years ago
Manu S Ajith 777c69b1d6
Migrate HTTPoison to Finch (#2054)
Signed-off-by: Manu S Ajith <neo@codingarena.in>

Signed-off-by: Manu S Ajith <neo@codingarena.in>
4 years ago
Baoshuo eac4660354
Update links to documents 4 years ago
Uku Taht 5c83ea77de Remove cache reporting to logs 4 years ago
Manu S Ajith c7a9da75b4
Enable Cachex stats (#2100)
Signed-off-by: Manu S Ajith <neo@codingarena.in>

Signed-off-by: Manu S Ajith <neo@codingarena.in>
4 years ago
Manu S Ajith c0c36646e2
Add Custom telemetry for Plausible.Event.WriteBuffer, Plausible.Event.WriteBuffer and Cachex (#2095)
* Add Custom telemetry for Plausible.Event.WriteBuffer, Plausible.Event.WriteBuffer and Cachex

Signed-off-by: Manu S Ajith <neo@codingarena.in>

* Rename telemetry.ex to avoid confusion with Phoenix Telemetry supervisor

Signed-off-by: Manu S Ajith <neo@codingarena.in>

* Remove duplicate event

Signed-off-by: Manu S Ajith <neo@codingarena.in>

Signed-off-by: Manu S Ajith <neo@codingarena.in>
4 years ago
Uku Taht a5757bc61e Allow ownership transfers 4 years ago
Vinicius Brasil 6b8ed12567
Fix Google Search Console API call (#2090)
This commit fixes a bug where fetching Google Search Console keywords
raised a FunctionClauseError. This was introduced in #2046. This commit
also adds test coverage.
4 years ago
ruslandoga ce461b5192 Auth updates 4 years ago
Vinicius Brasil d41fd68e99
Create struct for event requests (#2084)
* Create struct for saving ingestion request

* Create separate function to buffer events
4 years ago
RobertJoonas a058cf6240
added a test and changed hashmode condition (#2082) 4 years ago
Vinicius Brasil 4b9032d822
Google Analytics Import Refactor (#2046)
* Create separate module for GA HTTP requests

* Fetch GA data entirely instead of monthly

* Add buffering to GA imports

* Change positional args to maps when serializing from GA

* Create Google Analytics VCR tests
4 years ago
Vinicius Brasil b415ebe776
Fix geolocation subdivision pattern matching (#2063)
* Fix geolocation subdivision pattern matching

This commit fixes a bug where regions were not being saved. This was
caused because Geolix response was returning an additional
`:geolocation` map key. It also adds a test case for this.

Closes #2033

* Add geolocation database to .gitignore
4 years ago
Manu S Ajith ca15b605b7
Filter out noisy exception from Sentry (#2058)
Signed-off-by: Manu S Ajith <neo@codingarena.in>
4 years ago
Vinicius Brasil b5ea6ae3dc
Keep user filter when listing cities, countries, and regions stats (#2030)
This commit fixes a bug where location filters were filtering stats but
not the locations list. This was caused by a `Map.put/3` call that
overrides the user filter. This commit rollbacks 5b57143273
changes and removes the `Map.put/3` call.

Closes #1982
4 years ago
Marko Saric 2eec492f45
Remove the note about hiring (#2020) 4 years ago
Uku Taht 4a33cd0a25 Delegate to default Sentry filter 4 years ago
Uku Taht 6fbb0a24a8 Do not log Sentry.CrashError to Sentry
Stops recursive error logging to sentry
4 years ago
Sasha Fonseca db3a852f26
Fix missing 'pageviews' column from 'pages.csv' (#1988)
* Fix missing 'pageviews' column from 'pages.csv'

* Add CHANGELOG entry for Issue #1878 fix
4 years ago
Adam Rutkowski 3b82ba0e25
Upgrade to Geolix 2.0 (#1997)
* Upgrade geolix

* Remove geolix pool config

* Save unnecessary Task.async_stream roundtrip

Normally the Geolix API accepts `:where` keyword option that designates
the database to look up. In case no parameter is supplied, it'll spawn
a parallel map over all databases available. In this case we have only
one DB anyway, so there is no need for the extra instrumentation.

* Follow up on direct :geolocation lookups
4 years ago
Manu S Ajith 81f18ff0a5
Setup promex (#1999)
* Setup promex

Signed-off-by: Manu S Ajith <neo@codingarena.in>

* Cleanup promex config file

Signed-off-by: Manu S Ajith <neo@codingarena.in>
4 years ago
Uku Taht 2b8e3ea62a
Use finch in sentry client (#1996)
* Introduce Finch for Sentry integration

* Make sure the DummyAgent can be started

* No need to sanitize the dsn, finch takes care of that

* Simplify the dummy child spec

* Annotate redirects clause

* Make use of new `get_int_from_path_or_env`

* Actually use finch in Sentry config

* Configure `excluded_domains` correctly for Sentry

The way sentry is configured currently, when we get an HTTP error it
will be logged twice - once from Sentry.PlugCapture and once from
Sentry.LoggerBackend. The logger backend module does the right thing
by default but for some reason we've been overriding the config
parameter that by default stops double-counting errors. This commit
returns to the default configuration which is better.

* Default to 15s timeout

* Attempt to send twice at most

* Warn in sentry client

* Use warn level in sentry client

Co-authored-by: Adam Rutkowski <hq@mtod.org>
4 years ago
Uku Taht 0553fa041b Parse geolix pool config as integers 4 years ago
Uku Taht 1cdffb098e Revert "Temporarily return 404 for favicons"
This reverts commit 8d3bdd9816.
4 years ago
Uku Taht 8c94e52f0f Adds tracing attribute when event ingest is blocked 4 years ago
Uku Taht 292a419473
Add feature flag to block event ingest (#1991)
Event ingest can be blocked using the flag `block_event_ingest`
4 years ago
Uku Taht 8d3bdd9816 Temporarily return 404 for favicons 4 years ago
Uku Taht 9617bd41b3 Revert "Add task to remove a page from the database"
This reverts commit 566d1b917a.
4 years ago
Uku Taht 58cb2f19ae Add feature flag for google analytics imports 4 years ago
Uku Taht 566d1b917a Add task to remove a page from the database 4 years ago
Marko Saric cd73df694c
We are looking for a Technical Customer Success Manager (#1977) 4 years ago
Uku Taht de17154f58 Show custom event goal form by default 4 years ago
Marko Saric e7dda24930
removing the note that we're hiring (#1958) 4 years ago
Marko Saric 2f9dbfc4a6
Changing sites into stats in this message as well (#1953)
just to make sure that it's the stats rather than actual sites that get locked
4 years ago
Uku Taht 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
Kurt McAlpine b92889aaf0
Add API to retrieve site by domain (#1942) 5 years ago
Uku Taht 30b3cc1ed6 Add error state when no data is returned from GA API 5 years ago
Uku Taht 102ff1885e Trim trailing whitespace from pathname 5 years ago
Marko Saric 2ebdf61c2b
Keep the public and in-app footers consistent (#1936)
i've tried to make the two footers consistent to include the different links we were missing in the in-app footer (terms, dpa...) but also to display the new job opening for those that are logged in. i don't have a way to test it so hopefully i didn't make any mistakes
5 years ago
Marko Saric 1e2e1d83fb
Update ownership_transfer_request.html.eex (#1929) 5 years ago
Uku Taht 76edeb8276 System route 5 years ago
Uku Taht 892133d036 Parse build information 5 years ago
Uku Taht b667d65d52 Move ARG to running container instead of build container 5 years ago
RobertJoonas 225c1138b6
CRM improvements (#1903)
* lock/unlock sites, show user role, link to manage subscription

* merged remove gp and unlock sites into one single action + code style tweaks
5 years ago
Uku Taht 5b5c70b82d Add build metadata to build arg 5 years ago
Uku Taht 47fc09bacf Add version file directly to priv 5 years ago
Uku Taht da93f2aa6e Remove dead code 5 years ago
Uku Taht 7ab9a43324 Remove version.json from static file list 5 years ago
Uku Taht 32116fe2c9 Show database library in info endpoint 5 years ago
RobertJoonas 11654ddc07
Script extension additions (#1915)
* added data-include attribute to plausible.exclusions.js

* reorder extensions in filename when serving the plausible script

* fix formatting

* tweaks after review

* changelog update
5 years ago
Uku Taht cd8df23e5e Do not rely on insertion order in tests 5 years ago
Uku Taht 6f3399bb7c Fix annual notification loop 5 years ago
Uku Taht d100f1400d Show version number 5 years ago
Uku Taht e374c142f3 Fix shared link display 5 years ago
Vignesh Joglekar b7b69c6f62
Adds "invite_only" disable_registration config option (#1841)
* Adds tri-state disable_registration config

* Formatting

* Changes variable back to atom

* Changelog

* Uses atoms correctly :/

* Swaps to a more fitting value

* Formatting
5 years ago
Uku Taht eeaefc1ad0 Only show db-ip notice when relevant 5 years ago
Marko Saric 2a31f7911a
Fix Innenstadt I (#1877) 5 years ago
Uku Taht 66225a69e4 Set 30 minute session expiration 5 years ago
Uku Taht 02abbda06d Ignore nil custom prop as well 5 years ago
Uku Taht c92c548ca8 Do not error on empty string custom prop value 5 years ago
Uku Taht 660e5d37c9 Remove unused import 5 years ago
Uku Taht f18a211dcc
Ingest throughput improvement test setup (#1867)
* Add OTEL and test Cachex for sessions

* Move load test

* Start apps in the appropriate order
5 years ago
Uku Taht 26ff56d257 Use safe version for sending check stats email 5 years ago
Parker Selbert a64cc84db2
Expand oban error tracking for plugins/notifiers (#1864)
* Plugin exceptions may be silently covering up database problems such
  as failed cron job inserts.
* The previously tracked `:circuit` event is no longer emitted.
5 years ago
Uku Taht ce55dc4ae9
Retries Google Analytics API request if it returns empty rows (#1858)
* Retries Google Analytics API request if it returns empty rows

* Remove HTTPoison.Retry completely
5 years ago
RobertJoonas 199206babc
Dimensions continued (#1847)
* added the first version of dimensions extension

* finished dimensions script extension + updated tracking to use it

* script variants build
5 years ago
Uku Taht 5e415c2420 Add entry_props back in 5 years ago
Uku Taht 8fb4f3f886 Revert entry props 5 years ago
Uku Taht 428ee747c3 Hook up flags to the custom prop filter 5 years ago
RobertJoonas 40275b64d4
Pageview custom dimensions (#1816)
* added custom dimension filtering tests for pages

* first filter UI in place

* pages, entry pages and exit pages can be filtered by pageview props

* added tests for expected filtering behaviour

* fix dimension filter for sources + tests

* added is_not filtering functionality

* fixed formatting

* fixed admin_test

* added (none) as filter value + is_not filter type in UI

* added prefilling applied filter values and some UI tweaks

* added fetch options

* Make prop suggestions work with `props` filter

* Fix test

* Track login state internally

* Add CHANGELOG entry

Co-authored-by: Uku Taht <uku.taht@gmail.com>
5 years ago
Uku Taht 7c1d64458e Add fun with flags library 5 years ago
Marko Saric 13d8eecc91
add GA importer (#1840) 5 years ago
Uku Taht 9bb7f52887 Remove sensitive page from tracking 5 years ago
Uku Taht 66aceda9e9 Fix main graph selection with imported data 5 years ago
Uku Taht 05c210ad85 Enforce site limit 5 years ago
Uku Taht 3d231fc094 Redirect to correct change plan page for enterprise customers 5 years ago
Andrea Mazzarella 1128ff4bfa
Update the internal /sites api to paginate results (#1824)
* Update the internal /sites api to paginate results and adapts site-switcher to it

* Update the Changelog

* Format internal controller

* Remove the `+ Add Site` link from the site-switcher in the dashboard

* Change camel to snake case and replace imports with fully qualified calls

* Remove trailing comma from site-switcher
5 years ago
Uku Taht d2dc06ec96 Fix trial notifications 5 years ago
Vignesh Joglekar 3b97ecdc62
Adds Main Graph Metric Selection (#1364)
* First pass bringing in previous graph improvements, and comparsion context

* 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

* Uses new timeseries API, various UI improvements, descopes conversions, ToP from graphing

* Fixes Mobile UI Issues

* Improves point detection and display on hover

* Fixes & adds tests for updated main-graph API route

* Changelog

* Changes to better metric option declaration & minor UI/default fixes

* Fixes top stat tooltips showing unformatted numbers for special (non-rounded) top stats

* Formatting

* Fixes regression with dashed portion not stopping at present_index

* Removes comparison + lint

* Improves top stat active style

* Removes comparison tests

* Splits out tooltip and top stats

Still needs:
- Tests
- Potentially more cleanup

* Adds/moves tests for top stats

* Formatting

* Updates metric LS key, removes console log

* Various fixes + cleanup

* Makes tooltip position & style more consistent

* Fixes test (returns import status on both main graph & top stats)

* Fixes interaction with month dateFormatter

* Fixes edge case tooltip behavior

It was simpler than I thought :/

* Make the entire top stat clickable

* Minor UI improvements

* Fixes another tooltip visibility edge case + cleans up boolean algebra

Co-authored-by: Uku Taht <Uku.taht@gmail.com>
5 years ago
Uku Taht 8655973069 Remove feature preview notice from GA import 5 years ago
Uku Taht f14c6c5cde Fix compile warning 5 years ago
Uku Taht 826e900c1b Make import date range look non-clickable
Because they aren't
5 years ago
Uku Taht 83c407c016
Upgrade Oban & configure Stager plugin (#1822) 5 years ago
Uku Taht 06b165eb6d Run GA import in monthly batches 5 years ago
Uku Taht 7c755d7c6d Forget has_stats 5 years ago
Uku Taht e572877cdd Use new field for all time date range as well 5 years ago
Uku Taht 5c290b1982 Use stats_start_date field on sites 5 years ago
Uku Taht 0f43f4a9df Remove unused function 5 years ago
Uku Taht 333de87ceb Add stats_start_date field 5 years ago
Uku Taht 69538e414d Fix dashboard link on Outlook 5 years ago
Marko Saric 4f45bb0480
added file downloads to the welcome email (#1811) 5 years ago
Uku Taht d40faf6ec7 More datepicker improvements 5 years ago
Uku Taht 7f58e6be4e Add Year to Date option in datepicker 5 years ago
RobertJoonas 8616dd46fb
added file-downloads script extension (#1775)
* added file-downloads script extension

* fixed the issues and made it compatible with IE

* changelog update
5 years ago
Uku Taht 8467979051 Add All Time option to datepicker 5 years ago
Uku Taht 18fd0dbe04 Always parse GA numbers as floats 5 years ago
Uku Taht ed871e7a0b Parse scientific notation in GA import 5 years ago
Uku Taht 0ab8d653be Add retry mechanism to HTTPoison 5 years ago
Uku Taht 8719865a41 Redirect user when they've already upgraded 5 years ago
Uku Taht ce649966ed Fix display 5 years ago
Uku Taht ebdd856df7 Fix tests 5 years ago
Uku Taht f00457c5d1 Change enterprise plans 5 years ago
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
5 years ago
Uku Taht c83e038af0 Add fallback if websiteUrl is not defined 5 years ago
Marko Saric dce82833e9
changed url to ga import docs (#1796) 5 years ago
Uku Taht ae78444830 Add notice about feature preview 5 years ago
Uku Taht 4cc4e0d61b Add config flag for import testers 5 years ago
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
5 years ago
RobertJoonas 492f47ba1e
Crm transfer data (#1749)
* pull from master

* added query generation by struct fields

* ready, improved tests

* fixed a naming mistake
5 years ago
Uku Taht 5dc024a5cf Debug API call 5 years ago
Uku Taht a375789f52 Deal with nil when importing 5 years ago
Uku Taht 3a0ec5481b Log import issue 5 years ago
Uku Taht 8aa38e146c Fix dark mode in settings general 5 years ago
Uku Taht cd7c4bd724 Convert end_date timezone correctly 5 years ago
Uku Taht 1f32c6d8f0 Fix dark mode for GA import 5 years ago
Uku Taht ad79678ed7 Add screen for user metric 5 years ago
Uku Taht 51cd24bcaf Allow user to cancel ongoing import 5 years ago
Uku Taht 0f58d56c11 Get real start date for date range 5 years ago
Uku Taht 445b8c5d43 Show real view ID 5 years ago
Uku Taht 203f87520b
Ga import improvements (#1784)
* Do not link Google account for import

* Record start date

* Fix tests
5 years ago
Uku Taht ea947a1401 Increase HTTP timeout 5 years ago
Uku Taht f42b694f15 Send import failed email when job errors 5 years ago
Uku Taht 1fb39957a6 Import Oban error handling 5 years ago
Uku Taht 83df555f55 Remove OTEL 5 years ago
Uku Taht e1d6d119b0 Add end date to GA import 5 years ago
Uku Taht c4f7c9a7a0 Add debug loggin to GA import 5 years ago
Uku Taht dd01d79f32 Update google branding 5 years ago
Uku Taht e026148fb0 Show better error message on duplicate domain
Co-authored-by: Marko Saric <me@markosaric.com>
5 years ago
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>
5 years ago
RobertJoonas b4992cedc1
Referrer spam blocklist (#1750)
* integrating blocklist library

* loads blocklist dependency from Github
5 years ago
Marko Saric 3ae2adc583
Use the correct email address for password reset (#1738) 5 years ago
Uku Taht 6bd4b73a91 Add clause for missing date 5 years ago
Uku Taht 8fa1d60ff0 Send cancellation email safely 5 years ago
RobertJoonas 775ae6228f
Streamlining support (#1723)
* can now remove user grace period from crm

* added a created_at column to users and sites in crm
5 years ago
Marko Saric c12346b6bf
Add a note to invite team members (#1715) 5 years ago
RobertJoonas 6b22806e1f
Allow admin access to locked dashboards (#1710)
* added super-admin access to locked dashboards

* fixed formatting
5 years ago
Uku Taht c2440dd96a Update tracking 5 years ago
RobertJoonas 5ef7baab70
removed a space from 6 mailto links (#1691) 5 years ago
Uku Taht b0b9b9212b Fixes password authentication issue with shared links 5 years ago
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.
5 years ago
Uku Taht 5b893bde39 Revert "Include 0 length pageviews in time_on_page calculation"
This reverts commit cee79e7875.
5 years ago
Uku Taht cee79e7875 Include 0 length pageviews in time_on_page calculation 5 years ago
Ralf Zimmermann 408d95fe09
Add custom goal props to breakdown endpoint (#1578) 5 years ago
RobertJoonas 78dbdfc092
Fix broken docs link in welcome email (#1646) 5 years ago
Uku Taht d1fe1f7e41 Cache the tracking script for 24 hours 5 years ago
Uku Taht 0505de9b42 Add site limit to enterprise upgrade plan 5 years ago
Uku Taht 52067803df Update session stats from event 5 years ago
ssendev 8077671f8a
Update session screen_size if unknown (#1610) 5 years ago
Uku Taht 0a5f6c5886 Implement wildcard filters for the API 5 years ago
Uku Taht ebb9476b56 Fix visit duration stat 5 years ago
Marko Saric 5bdd74a524
Some changes for the Netherlands (#1607) 5 years ago
Marko Saric 3e1a7a10bb
Some fixes for Austria (#1608) 5 years ago
Uku Taht 5344c477f3 Mix format 5 years ago
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.
5 years ago
Marko Saric 1f29d9d358
Change for Norway (#1618) 5 years ago
Marko Saric cc88526777
fixes for Zürich (#1612) 5 years ago
Uku Taht 6e21f28980 Access region safely 5 years ago
Uku Taht febfaa44e0 Dont error with unknown country 5 years ago
Uku Taht cd40579740 Ignore unknown country code 5 years ago
Uku Taht 81eb2b73df Notify Sentry when location code is not found 5 years ago
Uku Taht 381c7ac7bc Update domain 5 years ago
Uku Taht 23605c3d44 Add task for plans 5 years ago
Uku Taht e7f13f7d70 Remove debug statement 5 years ago
Uku Taht 35ee2fe3fb Parse bunny header 5 years ago
Uku Taht 3fb184a893 Log IP for testing 5 years ago
Uku Taht f049e7f358 Fix plan 5 years ago
Uku Taht 3f5151585a Mix format 5 years ago
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
5 years ago
Uku Taht 9a7d1dd686 Adjust dashboard locked copy 5 years ago
Uku Taht ecc233443e Remove duplicate entry from cities map 5 years ago
Uku Taht 6f4d5b7b8c mix format 5 years ago
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
5 years ago
Matt Colligan 8148d41e42
Add cities and regions to exported CSV data (#1485) 5 years ago
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
5 years ago
Uku Taht 50df61cefa Add v3 plans to all_plans 5 years ago
Uku Taht f1e6baa9df Better sentry error 5 years ago
Uku Taht 0b253421ce Fix tests 5 years ago
Uku Taht 9a77644517 Better sentry message when plan is not found 5 years ago
Uku Taht 880ea45cd9 Remove cities feature flag 5 years ago
Uku Taht d4e7d27df6 Merge branch 'new-plans' 5 years ago
Uku Taht 28ab506bb8 Set start time for v3 pricing 5 years ago
Uku Taht f5fee73363 Add city overrides for mexico city 5 years ago
Uku Taht 1bef6fda52 Add stockholm override 5 years ago
Uku Taht 3fffd0c05d Add city overrides 5 years ago
Uku Taht 0bf1da09ce New plans 5 years ago
Uku Taht 303533af60 Use new testing subfolder 5 years ago
Marko Saric 7fc53124d8
Fixed two typos (#1555)
* Update settings_email_reports.html.eex

* fixed two typos

upgrage = upgrade
tranfer = transfer
5 years ago
Uku Taht b5047edc22 Truncate domain name 5 years ago
Uku Taht 711cbdfca2 Remove unused custom domain code 5 years ago
Uku Taht 051294445a Always show settings cog 5 years ago
Uku Taht f34c90e26c Show UTM term and content 5 years ago
Uku Taht 4d97583331 Use safe email functions
Fixes #1545
5 years ago
Uku Taht d48eafc436 Temporarily disable utm_term and content from csv export 5 years ago
Uku Taht 4ea0e29620 Add UTM content and term to CSV export 5 years ago
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>
5 years ago
RobertJoonas 231c72e8e8
add vs cloudflare link to page footer 5 years ago
Uku Taht dc8d20496c Show locked message in shared link 5 years ago
Ralf Zimmermann faf4459b15
Add "events" metrics to public breakdown endpoint (#1529) 5 years ago
Uku Taht 66575f497b Add goal type to JSON response 5 years ago
Uku Taht 97cdc4814e Refactor goals API 5 years ago
Uku Taht 1dba113e2f
[Draft] Improve location translations (#1526)
* WIP

* Use location library for search suggestions

* Remove unused code

* Remove Countries completely

* Fix tests
5 years ago
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>
5 years ago
Uku Taht 442e401ede Use new location library 5 years ago
RobertJoonas 9022234aa6
added invoices section (#1511)
* added invoices section

* fixed formatting

* UI and code style improvements, paddle sandbox setup only on dev environment (fixed)
5 years ago
Uku Taht 139adc4056 Add more mobile browser rules 5 years ago
Uku Taht a2d0244315 Fix site locked email 5 years ago
Uku Taht 1bc9f6bfb5 Remove more dead code 5 years ago
Uku Taht 01706b7590 Remove dead code 5 years ago
Uku Taht 4d0bc61ffd Remove Twitter stuff 5 years ago
Uku Taht e7e36b994d Skip usage checking for users who are on grace period 5 years ago
Uku Taht effe56b3e4 Use new iso_codes package 5 years ago
Ru Singh 17563e99c5
UI fix: footer alignment on mobile (#1498)
* fix(ui): footer alignment on mobile

* docs(changelog): new entry for footer alignment
5 years ago
Uku Taht 7cfd9f95f1 Delete a site through the API 5 years ago
Uku Taht 07af25ffc3 Fix subscription_interval for enterprise plans 5 years ago
Uku Taht 9c07cf7ea6 Report allowance issues to Sentry 5 years ago
Uku Taht 2463296403 Fetch enterprise plan corretly 5 years ago
Uku Taht b695732521 Improve scroll behaviour on the dashboard 5 years ago
Uku Taht 37d3f2e36e Make sure that deleting an account also deletes stats 5 years ago
Uku Taht 5f6553c8d8 Remove DDG 5 years ago
Uku Taht 6fc0e7ba92 Use payment error 5 years ago
Uku Taht 7e93500834 Allow admins to access the stats API 5 years ago
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
5 years ago
Uku Taht dae99a94b2 Add note about embedded dashboard password protection 5 years ago
Uku Taht 6aa0d7405d Sample to 20m instead of 10m 5 years ago
Marko Saric aa5add2142
Update settings_email_reports.html.eex (#1486) 5 years ago
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>
5 years ago
Uku Taht 06d0d0eafa Fix over limit email reccommendation 5 years ago
Uku Taht 941a91ec22 Make better use of the index on sessions table 5 years ago
Uku Taht 218f1158d6 Show visitor counts in Search Console report
Fixes #1480
5 years ago
Uku Taht e355828465 Remove pageview filter by default 5 years ago
Uku Taht a3aede73f9 Let staging track itself 5 years ago
Uku Taht 6b55ace014 Fix error with JSON parsing 5 years ago
Uku Taht 0edf4765d4 Ignore maps in prop values 5 years ago
Uku Taht 373d05e8de Fix error with anonymous users on shared links 5 years ago
Uku Taht d3311898c5 Show message when grace period is over 5 years ago
Uku Taht e9cb8eb4e2 Remove grace period if user upgrades 5 years ago
Uku Taht ec2a4a1a65 Add [Action required] to over limit email 5 years ago
Uku Taht d547d0f996 Send email notification when sites are locked at grace period end 5 years ago
Uku Taht 29cb7462e6 Add grace period to upgrade 5 years ago
Uku Taht f88956ef3c Fix compiler warning 5 years ago
Uku Taht c4dcd87c08 Export fixes 5 years ago
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
5 years ago
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
5 years ago
Uku Taht 7a02aae2a5 Accept custom props in expected format 5 years ago
Matt Colligan d781301886 Apply existing filter to visitors.csv in export (#1454)
Also adds a test to ensure the filter always applies.
5 years ago
Uku Taht c9f68248d8 Fix error with conversion rate 5 years ago
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.
5 years ago
Uku Taht 5c02811d26 Add opentelemetry oban 5 years ago
Uku Taht 42d70bf4ea Optimization: only request top sources if notification is to be sent 5 years ago