* Refactor and unify auth plugs for Stats and Sites APIs
* Expose get site Sites API endpoint to all API keys
* Test the new plug
* Add test for endpoint with modified scope
* Fix typos
Co-authored-by: hq1 <hq@mtod.org>
* Rename plug for consistency (h/t @aerosol)
---------
Co-authored-by: hq1 <hq@mtod.org>
* add notice about pending ownerships counting towards usage
* Refactor feature usage to take site_ids too
* Add option to query usage from pending ownerships
* count pending ownerships towards usage on the choose-plan page
* turn 'eligible_for_upgrade?' into a predicate
* fix variable names on ce
* fix unused alias on ce
* fix ce test
* WIP new querying
* WIP: Move some aggregate code under new command
* WIP: Add joins, handling less metrics
* join events table to sessions if needed
* Merge imported results with built query
* Remove dead code
* WIP: /api/v2/query
* Allow grouping by time
* Use JOIN for main query
* Build query result
* update parse_time
* Make joinless order by work
* First test
* more breakdown tests
* Serialize event:goal filters in an json-encodable way/reflection
* Handle inner vs outer ORDER BY clauses properly
* Handle single conversion_rate metric
* Update more tests
* Get parsing tests passing again
* Validate filtered goal filter is configured
* Enable more validation tests
* Enable more event:name breakdown tests
* Enable more breakdown tests
* Validate site has access to custom props
* Validate conversion_rate metric which is only allowed in some situations
* Validate that empty event:props: is not valid
* handle query.dimensions properly in table_decider
* test more validations on metrics/dimensions
* Validate session metrics in combination with event dimension(s)
* Tests cleanup
* Parse include.imports
* Get imports working with new querying
* Make more imports tests work
* Make event:props:path imports-adjacent test work
* Get query imports warning-related tests running
* Remove dead pagination tests
* Solve dead import
* Solve some warnings
* Update aggregate metrics tests
* credo
* Improve test naming
* Lazy goal loading
* Use datetime methods
* Ecto -> SQL module name
* Remove Expression.dimension mode option
* Make goals accept wildcards in :is queries
* Add support for contains/does_not_contains in the backend
* Support all operations for event custom properties
* Support does_not_contain on the frontend
* Changelog entry
* Render filter operations nicely for does not contain
Found 3 extra pixels for operation dropdown
* Remove multiple_filters feature flag
* Set default selected tab to last cycle when rendering usage
...And never disable this tab.
* rename Ongoing cycle to Upcoming cycle
* fix tests
* mix format
* Implement autoprefill of enterprise plan fields on user change
* Implement sanitizing input attrs in enterprise plan CRM form
* Implement number formatting for monthly pageview limit input in CRM form
* Link subscription status to Paddle profile whenever available
* Display usage info directly in user form in CRM
* Handle pageview limit fallback gracefully when rendering subscription quota
* Remove usage page link from users list view in CRM
* Add tests for usage page
* Apply `raw/1` only to the one (and only) element of the list
* pull last_bill_date from paddle sandbox in mix task
* move cycle usage checks to Quota module
* move quota.ex to a subfolder
* split up Quota module
* set choose-plan pageview slider according to usage
* silence credo
* Do not parse query params from dogfooded events
* Revert "Do not parse query params from dogfooded events"
This reverts commit ee97b87864.
* Ignore URL params entirely when dogfooding demo dashboard
* Revert "Revert "Multiple filters on the frontend (#4174)" (#4218)"
This reverts commit 2f7dcae991.
* Make city links work again
By enforcing everything sent to the BE is stringified. We do this at serialization-time to ensure old dashboard links still work
* Add new logic for query parsing
Note this is not yet final, but this scaffolding will soon be used
* Send filters to BE in new encoding, flag add more button
* query.property -> query.dimensions
* Reduce number of operations for filtering
This helps ensure we can be consistent/simple with apiv2
* Update search console filter mapping
* Update filters sent from frontend
* Update new filter parsing
* Remove redundant clause
* Make filtering by event:goal work
* Handle * as old backend did - prefix/suffix by **, if not using wildcards already
* Update imports logic
* Credo warning
* Spacing for add row button in filter modals
* query fix
* LegacyDashboardFilterParser
* only single hostname filter allowed
---------
Co-authored-by: Uku Taht <uku.taht@gmail.com>
* Start suggesting event names in goal settings form
* Fix tests
* Bump phoenix_live_view to 0.20.12
* Implement a criminal hack to track removal of modal's child live components
* Revert "Implement a criminal hack to track removal of modal's child live components"
This reverts commit f34ceb78f1.
* Remove redundant closing brace from currency combo input
* Hide batch goal add button when tab selection is in progress
* Implement unique modal ID regenerated on every modal close/open cycle
* Use unique modal ID as ID suffix to live components in goal settings form
* Reset suffix on tab selection to reset live components state on switch
* Revert "Bump phoenix_live_view to 0.20.12"
This reverts commit 1b1c801981.
* Make unique IDs more predictable
* Fix tests for `GoalSettings.Form`
* Use unique modal ID in country rule modal
* Use unique modal ID in hostname rule modal
* Use unique modal ID in page rule form modal
* Don't limit detected goals when fetching them for autoconfigure
* Escape interpolated Alpine state function argument
* Exclude goals with whitespace on either end or consisting only of whitespace
* Ensure event name suggestions update after goal deletion
* Avoid showing loading spinner when closing modal
* Don't enable spinner when new combobox selection is identical
* Revert "Don't enable spinner when new combobox selection is identical"
This reverts commit a041ba8542.
* Bootstrap OpenAPI Funnel schemas
* Implement Plugins API Funnel view
* Allow casting funnel step directly from `%Goal{}`
* Check feature availability on funnel creation
just like it's done when inserting goals
* Implement Plugins API context module for Funnels
* Implement GET/PUT funnels via Plugins API
* Fix typo
* A rare event in which dialyzer found an actual bug, wow!
* Format
* Wrap creation request with a root `funnel` key
* Format
* Extract common funnel get query
* Remove redundant tag
* Refactor queries a bit
* prioritize other skip_imported_reasons over not requested
* return with_imported_switch info from top stats
* fix the with-imported-switch component
* Refactor ImportedQueryUnsupportedWarning
* do not render warning bubble when imported data not requested
* stop displaying warning bubble before the API response is received
* fix tab switch pills jumping due to bubble height
* drop loading condition of ImportedQueryUnsupportedWarning for Funnels
* add explicit check for realtime when rendering the bubble
* remove unused JS imports
* rename snake_case to camelCase
* move imported.ex to imported subfolder
* move constructing base imported query into a separate module
* Implement imported table deciding and filtering
+ tests for pages, entry_pages, exit_pages and common filter types
* add top stats test with country filter
* add timeseries test
* Drop bounce_rate and time_on_page from imported & page-filtered Top Stats
* rename field returned by top stats
* turn pages into a fn comp
* Move dashboard API results under a results key
...and also return the skip_imported_reason to the frontend to be used
for displaying warnings.
* extend ListReport component with an optional afterFetchData prop
* turn Devices into a fn comp
* add not_requested as a skip_imported_reason
* display warning icons in the dashboard
* Implement filtering suggestions and translate filter fields for imported
* WIP
* Improve and cover filtering suggestions with tests
* Rename imported suggestions query helpers
* fix screen size breakdown with screen size filter
* support filtering by the same suggestion property
* support location filters when fetching location suggestions
* support filtering by multiple props from the same table
* Implement filtering by goals
* Make views per visit metric work for import entry and exit pages
* Get rid of circular dependencies between Stats.Imported and Stats.Imported.Base
* Clean up Query struct manipulation in Breakdown
* Rename helper function for clarity
* Automatically refresh query struct state after modifications
* Shutup credo
* display imported warning bubble in prop breakdown section
* Render warning bubble for funnels whenever imported data is in the view
* Transform any operator on respective goal filters
* Fix percentage and conversion_rate calculation in presence of custom props
* add tests for for combining page and pageview goal filters
* add skip_refresh option to query tweaking functions
* add imported CR support for timeseries
* still show url breakdown when special goal + url in filter
* rename Query.refresh
* use flat_map instead of map and concat
* fix darkmode color
* Handle invalid imported region codes in suggestions gracefully
* Add an entry to CHANGELOG.md
---------
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
* Allow running browserless.io locally
* Compile tailwind classes based on extra/ too
* Add browserless runtime configuration
* Ignore verification events on ingestion
* Improve extracting HTML text in tests
* Update dependencies
- Floki will be used on production to parse site contents
- Req will be used to handle redundant stuff like retrying etc.
* Add shuttle SVG to generic components
Later on we'll use it to indicate verification errors
* Connect live socket & allow skipping awaiting the first pageview
* Connect live socket in general settings
* Implement verification checks & diagnostics
* Stub remote services with Req for testing
* Change snippet screen copy
* Update tracker script, so that:
1. headless browsers aren't ignored if `window.__plausible` is defined
2. callback optionally supplies the event response HTTP status
This will be later used to check whether the server acknowledged
the verification event.
* Implement LiveView verification UI
* Embed the verification UIs into settings and onboarding
* Implement browserless puppeteer verification script
It:
- tries to visit the site
- defines window.__plausible, so the tracker doesn't ignore test events
- sends a verification event and instruments the callback
- awaits the callback to fire and returns the result
* Improve diagnostics for CSP
Only report CSP error if the snippet is already found
* Put verification behind a feature flag/env setting
* Contact Us hint only for Enterprise Edition
* For headless code, use JS context instead of EEx interpolation
* Update diagnostics test with WordPress scenarios
* Shorten exception/throw interception
* Rename test
* Tidy up
* Bust URL always on headless check
* Update moduledoc
* Detect official Plausible WordPress Plugin
and act accordingly on diagnostics interoperation
* Stop using 'rating' in favour of 'interpretation'
* Only report CSP error if no proxy is likely
* Update CHANGELOG
* Allow event-* attributes on snippet elements
* Improve naive GTM detection, not to confuse it with GA4
* Update lib/plausible/verification.ex
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
* Update test/plausible/site/verification/checks_test.exs
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
* s/perform_wrapped/perform_safe
* Update lib/plausible/verification/checks/installation.ex
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
* Remove garbage
---------
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
Deployment needs to be coordinated with WordPress plugin
update. Reasoning: there's too much confusion coming
from the use of the "API" terminology, leading to wrong
keys being generated by users.
* Fix broken hostname property and handle missing imported metrics gracefully
* Add test for CSV export of imported data
* Add extra coverage for property and metric combox which were failing
* Compute visit duration and bounce rate for exit pages in imported data
* Drop support for breaking down by `event:hostname` property for now
* New struct format for query after parsing
* WIP refactoring
* WIP: Validations working
* WIP: tuple to list
* continued refactoring
* WIP: parsing defaults
* Breakdown tests pass
* Window functions fix
* Fix default
* Remove dead argument
* Update filters tests
* Update query_test.exs
* Fix table_decider
* sources tests pass
* Filter suggestions fix
* revenue/goal filter applied refactor
* Update top_stats matching
* Get stats_controller tests passing
* Update neighbor_aggregate_time_on_page
* Refactor Query.remove_event_filters into Query.remove_filters, add new callsites
* Move goal where clause building to new WhereBuilder module
* Move event:name filters
* Move more filters to WhereBuilder
* Update fragment to allow non-static meta columns
* Build where clause for events table using WhereBuilder
* Build sessions table where clause using WhereBuilder
* Move time range filtering and site checking to WhereBuilder
* WhereBuilder.build_condition method
* Remove TODO
* _rest pattern for TableDecider, Query pattern matching
Future-proofing in a tiny way
* Hacky fix to get tests passing for Google API tests
* Typespec fix
* Merge conflict
* refactor special goal filter logic in imported.ex
* Docs feedback
* put_filter
---------
Co-authored-by: Robert Joonas <robertjoonas16@gmail.com>
* Apply filters in search console request
* Remove dead code from search console modal
* Remove unimportant information from keyword modal
* Show invalid filters from search console
* Fix tests
* Add/Fix tests
* Fix typo
* Remove unused variable
* Fix typo
* Changelog entry
* Fix Credo
* Display impressions, CTR and position in keyword modal
* Undo change that should not have been committed
* Fix test
* Fix test
* filters -> search_console_filters
* add new goal suggestions API
* silence credo
* Order suggestions from subqueries explicitly
* allow autoconfiguring goals
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
* Fix form modal tab switching behavior
* add test
* Remove redundant and invalid action link title
---------
Co-authored-by: Adrian Gruntkowski <adrian.gruntkowski@gmail.com>
* Add Ecto schema for imported custom events
* Start importing custom events from GA4
* query imported goals
* make it possible to query events metric from imported
* make it possible to query pageviews in goal breakdown
* make it possible to query conversion rate
* fix rate limiting test
* add CR tests for dashboard API
* implement imported link_url breakdown
* override special custom event names coming from GA4
* allow specific goal filters in imported_q
* update GA4 import tests to use Stats API
* Improve tests slightly
* Update CHANGELOG.md
---------
Co-authored-by: Robert Joonas <robertjoonas16@gmail.com>
* keep breakdown prop in the query struct
* Explicitly ignore property param in aggregate and timeseries
Since parameter validation depends on the breakdown property, we need to
make sure it doesn't have any unexpected effect in endpoints where it's
not expected.
* Add support for resuming import to GA4 importer
* Handle rate limiting gracefully for all remainig GA4 HTTP requests
* Show notice tooltip for long running imports
* Bump resume job schedule delay to 65 minutes
* Fix tooltip styling