-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add hooks to Sophi requests #257
Conversation
Related to #219 |
@oscarssanchez @felipeelia @iamdharmesh @Sidsector9 @dinhtungdu looking for a quick review from one of you on this one to get merged in to support Max's work on the debug bar integration. |
Kudos, SonarCloud Quality Gate passed!
|
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.
LGTM!
Description of the Change
This PR introducing new hooks to remote requests:
Hooks for Site Automation
sophi_request_args
filter: Filters the arguments used in Sophi HTTP request.sophi_request_result
filter: Filters a Sophi HTTP request immediately after the response is received.Used in:
SophiWP\SiteAutomation\Request::request()
andSophiWP\SiteAutomation\Auth::request_access_token()
Hooks for event tracker
sophi_tracking_data
filter: Filters the data used in Sophi track event request.sophi_tracking_result
action: Fires after tracker sends the request.Since the entire
$data
array is sent to Snowplow, looks it not safe to add new attributes to the array (f.e. for debugging). That's why we add theSnowplow\Tracker\Tracker $tracker
object as a reference in both filters.Used in:
SophiWP\ContentSync\send_track_event()
sophi_tracker_emitter_debug
filter: Allows to enable debug mode in the emitter to save responses and analyse them later.Used in:
SophiWP\ContentSync\init_tracker()
Closes #255
Possible Drawbacks
Checklist:
Changelog Entry
Credits
Props @cadic