You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+57Lines changed: 57 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,6 +17,63 @@ Documentation is automatically generated from source code comments and rendered
17
17
Usage
18
18
----------
19
19
20
+
### `AdobeAnalyticsEngine`
21
+
`AdobeAnalyticsEngine` implements the `AnalyticsEngine` protocol, and in its `track(event:)` method it maps the `AnalyticsEvent` enum to the appropriate Adobe methods.
22
+
23
+
Internally the Adobe SDK is just using singleton objects, but the goal of Y—Analytics is to use Dependency Injection of a generic wrapper. This allows your project code to be loosely coupled to your choice of analytics provider. It also facilitates unit testing and a healthy app architecture.
24
+
25
+
Just be aware that even if you declare multiple instances of `AdobeAnalyticsEngine`, that they all reference the same Adobe SDK singleton.
26
+
27
+
When unit testing various components of your project, you should inject an instance of `MockAnalyticsEngine` instead of the Adobe engine. This allows your unit tests to run without any Adobe dependency and allows you to verify which events are tracked and when.
28
+
29
+
#### Simple use case: app ID
30
+
You may initialize `AdobeAnalyticsEngine` by passing an Adobe app ID.
31
+
32
+
```swift
33
+
importYAnalyticsAdobe
34
+
35
+
finalclassAppCoordinator {
36
+
let engine: AnalyticsEngine = {
37
+
let config =AdobeAnalyticsConfiguration(appId: "S3cr3t!")
0 commit comments