Skip to content
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

Merged
merged 8 commits into from May 14, 2024

Conversation

zoldar
Copy link
Contributor

@zoldar zoldar commented May 10, 2024

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

  • Automated tests have been added

Changelog

  • Entry has been added to changelog

Documentation

  • Docs have been updated

@zoldar zoldar force-pushed the support-custom-events-in-csv-exports-and-imports branch from 3868d0c to 6d20385 Compare May 10, 2024 11:04
@zoldar zoldar added the deploy-to-staging Special label that triggers a deploy to a staging environment label May 10, 2024
@zoldar zoldar force-pushed the support-custom-events-in-csv-exports-and-imports branch 5 times, most recently from fbb0419 to 982d616 Compare May 14, 2024 08:28
@zoldar zoldar force-pushed the support-custom-events-in-csv-exports-and-imports branch from 621b5ee to 9a474a5 Compare May 14, 2024 10:47
@zoldar zoldar requested a review from RobertJoonas May 14, 2024 10:49
@zoldar zoldar marked this pull request as ready for review May 14, 2024 10:53
@zoldar zoldar requested a review from a team May 14, 2024 10:53
@zoldar zoldar merged commit 9374a95 into master May 14, 2024
8 checks passed
@zoldar zoldar deleted the support-custom-events-in-csv-exports-and-imports branch May 14, 2024 11:50
"with_imported" => true
}
end

breakdown = fn params_or_site, by ->
breakdown = fn params_or_site, by, opts ->
Copy link
Contributor

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%
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deploy-to-staging Special label that triggers a deploy to a staging environment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants