-
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 visitor support #1564
Add visitor support #1564
Conversation
should update answers-search-bar as well to support visitor |
src/core/core.js
Outdated
@@ -127,12 +127,13 @@ export default class Core { | |||
/** | |||
* Initializes the {@link Core} by providing it with an instance of the Core library. | |||
*/ | |||
init () { | |||
init (visitor) { |
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.
Can we have a config param instead that we spread into the params object? That way it's not specific to the visitor and the init could be written as oshi suggested: this.core.init({ visitor: parsedConfig.visitor });
?
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.
updated!
## Version 1.12.0 ### Features - Allow search rate tracking (#1558) - Add support for setting and changing the visitor and passing it to answers-core (#1564) - Add support for the auth token that is passed in from the config (#1566) - Add an `environment` field to support consumer auth in Sandbox (#1597) - Allow components to override the beforeMount function (#1547) - Add distance to the card data and a function to format it (#1550) - WCAG updates (allow pagination with Enter (#1575), identify current page in navigation tab (#1576), update autocomplete screen reader support (#1578, #1579)) ### Changes - Update directAnswers component data to include the searcher (#1596) - Use custom alerts instead of window.alert (#1549) - Update Mapbox version to match the Theme (#1551) - Internal repo changes (#1562, #1577) ### Bugfixes - Fix console error which would appear on google maps (#1548) - Fix FAQ expansion when default is expanded (#1553) - Fix error for searches on page load with no businessId (#1561)
Accept visitor object in
init
and allow visitor to be set or changed usingsetVisitor
. If a visitor is set, it is passed to all analytics events and to a new Answers Core instance.J=SLAP-1620
TEST=auto, manual
Add jest tests for setting and changing the visitor. Check if visitor is sent during analytics events and searches in test-site.