-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export and import custom events via CSV #4096
Export and import custom events via CSV #4096
Conversation
3868d0c
to
6d20385
Compare
fbb0419
to
982d616
Compare
621b5ee
to
9a474a5
Compare
test/plausible_web/controllers/api/external_stats_controller/breakdown_test.exs
Show resolved
Hide resolved
"with_imported" => true | ||
} | ||
end | ||
|
||
breakdown = fn params_or_site, by -> | ||
breakdown = fn params_or_site, by, opts -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
props/goals can have a separate specialised function
# page breakdown's visit_duration difference is within 1% | ||
assert summary(field(exported_pages, "visit_duration")) == [0, 0, 25, 217.5, 743] | ||
assert summary(field(imported_pages, "visit_duration")) == [0, 0, 25, 217.55, 742.8] | ||
# NOTE: page breakdown's visitors difference is up to almost 43% |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it's visit duration
|
||
pairwise(exported_cities, imported_cities, fn exported, imported -> | ||
assert exported["city"] == imported["city"] | ||
assert exported["bounce_rate"] == imported["bounce_rate"] | ||
assert_in_delta exported["bounce_rate"], imported["bounce_rate"], 4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if delta is high, it might be better to be tested separately
assert exported["pageviews"] == imported["pageviews"] | ||
assert_in_delta exported["visit_duration"], imported["visit_duration"], 1 | ||
assert_in_delta exported["visit_duration"], imported["visit_duration"], 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
Changes
This PR implements support for importing and exporting custom events via CSVs.
Also, the raw CH dump fixture got replaced with a sample from a smaller site but with more varied set of goal types (including goals with url and path properties). The dump contains complete set of entries from the declared time range - no additional sampling is applied.
Tests
Changelog
Documentation