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
Changes from 22 commits
fc0d84f
0b6152e
27504b6
954f850
ffb3a9a
a1930f2
9259080
47ba6ff
e1b654d
511b064
cc81ac5
e42ff86
c65e83c
d4e9fe5
ec9334d
dbbb180
8c65a46
2879ba4
1ad9bd3
5a275e7
217d57e
2c217b2
2712d8b
da20e15
632e065
a4a2411
da8a37a
375f9b7
2bc5e8c
f88af53
bd937ca
875a1ec
0f15eed
6c7c5b6
e305c55
fb3c7aa
02e2d47
de1a54d
60df472
0d16a43
5267302
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
| 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; } | ||
| } |
| 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; } = []; | ||
| } |
| 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; | ||
| } |
| 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; } = []; | ||
| } |
| 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; } = []; | ||
| } |
| 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; | ||
| } | ||
| } |
| 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; } | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| } | ||
| 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; | ||
| } |
| 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; | ||
| } | ||
| } |
| 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(); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| namespace VirtoCommerce.GoogleEcommerceAnalyticsModule.Core.Models; | ||
|
|
||
| public class AnalyticsEventSummaryCriteria : AnalyticsEventCriteriaBase | ||
| { | ||
| } |
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. The key is
CacheKey.With(GetType(), operation, criteria.GetCacheKey()), andValueObject.GetCacheKey()joins every public property — event names, dimension filters, dimension names, take/skip, sort. "The store plus the query's dates" describes the date normalisation, not the key.It matters because this is the sentence a reader reasons from when deciding whether two reads share an entry, and read literally it says two different event-name queries collide.
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.
Fixed in
2712d8b— the sentence now says the key covers the whole query plus the resolved property id, with the day-rounding named separately as the reason two times of day share one entry.