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

EventsSDK: Add debug mode #130

Merged
merged 8 commits into from
Feb 15, 2024
Merged

EventsSDK: Add debug mode #130

merged 8 commits into from
Feb 15, 2024

Conversation

ejaffee01
Copy link
Contributor

Add a debug flag to AnalyticsConfig. When set to true events will not be sent to the Events API and additional information will be logged to console. The added logs are:

  • The AnalyticsConfig following the construction.
  • The Payload following the call to with
  • The two payloads that are passed into the merge function
  • The final request body that would be sent to the Events API
    • Will specify if fetch or beacon would be used
    • Will specify request url would be used
    • Will specify if session tracking is enabled
    • Explains to disable debug flag in order to actually fire the event

J=FUS-6239
R=abenno, mtian
TEST=manual

Enabled the debug mode in the test site. See screenshots below for logging examples.
Screenshot 2024-02-13 at 2 17 50 PM
Screenshot 2024-02-13 at 2 20 52 PM

@ejaffee01 ejaffee01 self-assigned this Feb 13, 2024
@ejaffee01 ejaffee01 marked this pull request as ready for review February 13, 2024 19:37
@ejaffee01
Copy link
Contributor Author

Coverage check is failing, but I think that may be okay for this commit. The coverage is still > 80%, and there is not really unit tests to write for the additions made in this PR. We could test what is expected to will print out in the logs, but I think that may be overkill.

@ejaffee01
Copy link
Contributor Author

Updated screenshots with logs in Chrome (fetch) with session tracking disabled and firefox (beacon) with session tracking enabled:
Screenshot 2024-02-14 at 11 39 31 AM
Screenshot 2024-02-14 at 11 40 49 AM

@ejaffee01 ejaffee01 requested a review from mtian725 February 14, 2024 16:46
Copy link
Collaborator

@mtian725 mtian725 left a comment

Choose a reason for hiding this comment

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

Left some comments

@ejaffee01
Copy link
Contributor Author

Updated screenshots
Screenshot 2024-02-14 at 5 17 01 PM

Screenshot 2024-02-14 at 5 16 17 PM

Screenshot 2024-02-14 at 5 17 17 PM

@ejaffee01 ejaffee01 requested a review from mtian725 February 14, 2024 22:21
src/AnalyticsEventReporter.ts Outdated Show resolved Hide resolved
src/AnalyticsEventReporter.ts Outdated Show resolved Hide resolved
src/AnalyticsEventReporter.ts Outdated Show resolved Hide resolved
src/AnalyticsEventReporter.ts Outdated Show resolved Hide resolved
src/AnalyticsEventReporter.ts Outdated Show resolved Hide resolved
src/AnalyticsEventReporter.ts Outdated Show resolved Hide resolved
@ejaffee01
Copy link
Contributor Author

Updated screenshot:
Screenshot 2024-02-15 at 11 52 36 AM

@ejaffee01 ejaffee01 merged commit 5c5bf20 into main Feb 15, 2024
10 of 12 checks passed
@ejaffee01 ejaffee01 deleted the debug branch February 15, 2024 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants