Repository navigation
VCST-5337: GA reports support #61
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
Merged
Merged
Changes from 32 commits
Commits
Show all changes
41 commits
Select commit
Hold shift + click to select a range
fc0d84f
Implementation (draft)
yuskithedeveloper 0b6152e
Implementation (draft)
yuskithedeveloper 27504b6
Diagnostics
yuskithedeveloper 954f850
Refactoring (SonarQube issues)
yuskithedeveloper ffb3a9a
SampleAnalyticsDataSource removed
yuskithedeveloper a1930f2
Obsolete settings removed
yuskithedeveloper 9259080
CI trigger
yuskithedeveloper 47ba6ff
CI trigger
yuskithedeveloper e1b654d
Localizations
yuskithedeveloper 511b064
Refactoring (/vc-module-review)
yuskithedeveloper cc81ac5
Refactoring (/simplify)
yuskithedeveloper e42ff86
Refactoring
yuskithedeveloper c65e83c
Refactoring
yuskithedeveloper d4e9fe5
Refactoring (optimization)
yuskithedeveloper ec9334d
Refactoring
yuskithedeveloper dbbb180
Refactoring (optimization)
yuskithedeveloper 8c65a46
Refactoring (optimization)
yuskithedeveloper 2879ba4
Refactoring
yuskithedeveloper 1ad9bd3
README.md
yuskithedeveloper 5a275e7
Refactoring (/vc-module-review)
yuskithedeveloper 217d57e
Refactoring (after alexeyshibanov review)
yuskithedeveloper 2c217b2
Refactoring (/vc-module-review)
yuskithedeveloper 2712d8b
Refactoring (after alexeyshibanov review, round #2)
yuskithedeveloper da20e15
Merge branch 'dev' into feat/VCST-5337-ga-event-search
yuskithedeveloper 632e065
Empty StoreId handling
yuskithedeveloper a4a2411
Refactoring (/vc-module-review)
yuskithedeveloper da8a37a
Docs, comments
yuskithedeveloper 375f9b7
index.md
yuskithedeveloper 2bc5e8c
Comment
yuskithedeveloper f88af53
Additional tests
yuskithedeveloper bd937ca
Comment
yuskithedeveloper 875a1ec
Merge branch 'dev' into feat/VCST-5337-ga-event-search
yuskithedeveloper 0f15eed
Merge branch 'dev' into feat/VCST-5337-ga-event-search
yuskithedeveloper 6c7c5b6
Merge branch 'dev' into feat/VCST-5337-ga-event-search
yuskithedeveloper e305c55
Add a Data API request timeout setting (default 45 s)
yuskithedeveloper fb3c7aa
Return the event total beside the row count
yuskithedeveloper 02e2d47
Read a named summary in one round
yuskithedeveloper de1a54d
Simplify the analytics read code
yuskithedeveloper 60df472
Let the report cache lifetime be 0
yuskithedeveloper 0d16a43
Merge branch 'dev' into feat/VCST-5337-ga-event-search
yuskithedeveloper 5267302
Drop the organization_name user dimension
yuskithedeveloper File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,15 @@ | ||
| Microsoft.Bcl.AsyncInterfaces.dll | ||
| Newtonsoft.Json.dll | ||
| Serilog.dll | ||
| System.CodeDom.dll | ||
| System.IO.Abstractions.dll | ||
| System.Management.dll | ||
| Testably.Abstractions.FileSystem.Interface.dll | ||
| TestableIO.System.IO.Abstractions.dll | ||
| TestableIO.System.IO.Abstractions.Wrappers.dll | ||
| TimeZoneConverter.dll | ||
| VirtoCommerce.CoreModule.Core.dll | ||
| VirtoCommerce.NotificationsModule.Core.dll | ||
| VirtoCommerce.Platform.Core.dll | ||
| VirtoCommerce.Seo.Core.dll | ||
| VirtoCommerce.StoreModule.Core.dll |
19 changes: 19 additions & 0 deletions
19
src/VirtoCommerce.GoogleEcommerceAnalyticsModule.Core/Exceptions/AnalyticsException.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| using System; | ||
|
|
||
| namespace VirtoCommerce.GoogleEcommerceAnalyticsModule.Core.Exceptions; | ||
|
|
||
| // Every IAnalyticsService failure arrives as this — no property id, a refused credential, a Google outage. The | ||
| // message names the store and the operation and nothing else; the cause stays in this module's log, because a | ||
| // consumer surfacing it cannot know how far its own error surface travels. | ||
| public class AnalyticsException : Exception | ||
| { | ||
| public AnalyticsException(string message) | ||
| : base(message) | ||
| { | ||
| } | ||
|
|
||
| public AnalyticsException(string message, Exception innerException) | ||
| : base(message, innerException) | ||
| { | ||
| } | ||
| } |
12 changes: 12 additions & 0 deletions
12
src/VirtoCommerce.GoogleEcommerceAnalyticsModule.Core/Models/AnalyticsDiagnosticsCheck.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| namespace VirtoCommerce.GoogleEcommerceAnalyticsModule.Core.Models; | ||
|
|
||
| public class AnalyticsDiagnosticsCheck | ||
| { | ||
| public string Stage { get; set; } | ||
|
|
||
| public string Status { get; set; } | ||
|
|
||
| public string Message { get; set; } | ||
|
|
||
| public string Detail { get; set; } | ||
| } |
14 changes: 14 additions & 0 deletions
14
...rtoCommerce.GoogleEcommerceAnalyticsModule.Core/Models/AnalyticsDiagnosticsReportShape.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| using System.Collections.Generic; | ||
|
|
||
| namespace VirtoCommerce.GoogleEcommerceAnalyticsModule.Core.Models; | ||
|
|
||
| public class AnalyticsDiagnosticsReportShape | ||
| { | ||
| public string Name { get; set; } | ||
|
|
||
| public IList<string> DimensionNames { get; set; } = []; | ||
|
|
||
| public string MetricName { get; set; } | ||
|
|
||
| public IList<string> EventNames { get; set; } = []; | ||
| } |
14 changes: 14 additions & 0 deletions
14
src/VirtoCommerce.GoogleEcommerceAnalyticsModule.Core/Models/AnalyticsDiagnosticsRequest.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| using System.Collections.Generic; | ||
|
|
||
| namespace VirtoCommerce.GoogleEcommerceAnalyticsModule.Core.Models; | ||
|
|
||
| public class AnalyticsDiagnosticsRequest | ||
| { | ||
| public IList<string> UserDimensionNames { get; set; } = []; | ||
|
|
||
| public IList<string> EventNames { get; set; } = []; | ||
|
|
||
| public IList<AnalyticsDiagnosticsReportShape> Reports { get; set; } = []; | ||
|
|
||
| public bool IncludeLiveData { get; set; } = true; | ||
| } |
8 changes: 8 additions & 0 deletions
8
src/VirtoCommerce.GoogleEcommerceAnalyticsModule.Core/Models/AnalyticsDiagnosticsResult.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| using System.Collections.Generic; | ||
|
|
||
| namespace VirtoCommerce.GoogleEcommerceAnalyticsModule.Core.Models; | ||
|
|
||
| public class AnalyticsDiagnosticsResult | ||
| { | ||
| public IList<AnalyticsDiagnosticsCheck> Checks { get; set; } = []; | ||
| } |
11 changes: 11 additions & 0 deletions
11
src/VirtoCommerce.GoogleEcommerceAnalyticsModule.Core/Models/AnalyticsDimensionFilter.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| using System.Collections.Generic; | ||
| using VirtoCommerce.Platform.Core.Common; | ||
|
|
||
| namespace VirtoCommerce.GoogleEcommerceAnalyticsModule.Core.Models; | ||
|
|
||
| public class AnalyticsDimensionFilter : ValueObject | ||
| { | ||
| public string DimensionName { get; set; } | ||
|
|
||
| public IList<string> Values { get; set; } = []; | ||
| } |
22 changes: 22 additions & 0 deletions
22
src/VirtoCommerce.GoogleEcommerceAnalyticsModule.Core/Models/AnalyticsEvent.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
|
|
||
| namespace VirtoCommerce.GoogleEcommerceAnalyticsModule.Core.Models; | ||
|
|
||
| public class AnalyticsEvent : ICloneable | ||
| { | ||
| public string EventName { get; set; } | ||
|
|
||
| public DateTime? OccurredAt { get; set; } | ||
|
|
||
| public int Count { get; set; } | ||
|
|
||
| public IDictionary<string, string> Dimensions { get; set; } = new Dictionary<string, string>(); | ||
|
|
||
| public virtual object Clone() | ||
| { | ||
| var result = (AnalyticsEvent)MemberwiseClone(); | ||
| result.Dimensions = Dimensions != null ? new Dictionary<string, string>(Dimensions) : null; | ||
| return result; | ||
| } | ||
| } |
21 changes: 21 additions & 0 deletions
21
src/VirtoCommerce.GoogleEcommerceAnalyticsModule.Core/Models/AnalyticsEventCriteriaBase.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using VirtoCommerce.Platform.Core.Common; | ||
|
|
||
| namespace VirtoCommerce.GoogleEcommerceAnalyticsModule.Core.Models; | ||
|
|
||
| public abstract class AnalyticsEventCriteriaBase : SearchCriteriaBase | ||
| { | ||
| public string StoreId { get; set; } | ||
|
|
||
| public IList<string> EventNames { get; set; } = []; | ||
|
|
||
| public IList<AnalyticsDimensionFilter> DimensionFilters { get; set; } = []; | ||
|
|
||
| public DateTime? From { get; set; } | ||
|
|
||
| public DateTime? To { get; set; } | ||
|
|
||
| // For a diagnostics probe: a feature read must not set it, since the cache is what protects the quota. | ||
| public bool BypassCache { get; set; } | ||
| } | ||
10 changes: 10 additions & 0 deletions
10
src/VirtoCommerce.GoogleEcommerceAnalyticsModule.Core/Models/AnalyticsEventSearchCriteria.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| using System.Collections.Generic; | ||
|
|
||
| namespace VirtoCommerce.GoogleEcommerceAnalyticsModule.Core.Models; | ||
|
|
||
| public class AnalyticsEventSearchCriteria : AnalyticsEventCriteriaBase | ||
| { | ||
| public IList<string> DimensionNames { get; set; } = []; | ||
|
|
||
| public string SortBy { get; set; } = ModuleConstants.SortBy.Date; | ||
| } |
20 changes: 20 additions & 0 deletions
20
src/VirtoCommerce.GoogleEcommerceAnalyticsModule.Core/Models/AnalyticsEventSearchResult.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using VirtoCommerce.Platform.Core.Common; | ||
|
|
||
| namespace VirtoCommerce.GoogleEcommerceAnalyticsModule.Core.Models; | ||
|
|
||
| public class AnalyticsEventSearchResult : ICloneable | ||
| { | ||
| public int TotalCount { get; set; } | ||
|
|
||
| public IList<AnalyticsEvent> Events { get; set; } = []; | ||
|
|
||
| public virtual object Clone() | ||
| { | ||
| var result = (AnalyticsEventSearchResult)MemberwiseClone(); | ||
| result.Events = Events?.Select(x => x.CloneTyped()).ToList(); | ||
| return result; | ||
| } | ||
| } |
17 changes: 17 additions & 0 deletions
17
src/VirtoCommerce.GoogleEcommerceAnalyticsModule.Core/Models/AnalyticsEventSummary.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| using System; | ||
|
|
||
| namespace VirtoCommerce.GoogleEcommerceAnalyticsModule.Core.Models; | ||
|
|
||
| public class AnalyticsEventSummary : ICloneable | ||
| { | ||
| public string EventName { get; set; } | ||
|
|
||
| public int TotalCount { get; set; } | ||
|
|
||
| public DateTime? LastOccurredAt { get; set; } | ||
|
|
||
| public virtual object Clone() | ||
| { | ||
| return MemberwiseClone(); | ||
| } | ||
| } |
5 changes: 5 additions & 0 deletions
5
...VirtoCommerce.GoogleEcommerceAnalyticsModule.Core/Models/AnalyticsEventSummaryCriteria.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| namespace VirtoCommerce.GoogleEcommerceAnalyticsModule.Core.Models; | ||
|
|
||
| public class AnalyticsEventSummaryCriteria : AnalyticsEventCriteriaBase | ||
| { | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Nit. This is a public settable flag that switches off what the module's own docs call a quota requirement rather than tuning, and the only thing keeping a feature read from setting it is this comment. Nothing in the repo sets it today.
The shape to watch is a consumer binding an
AnalyticsEventSearchCriteriafrom caller-supplied input — the flag then rides along with it. Narrower access, or a separate criteria type for the probe, would make the rule structural rather than advisory.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.
Deferred, not disagreed — a parameter would make the rule structural instead of a comment. Leaving it while this surface is still moving; noted for the pass that changes these signatures.