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

Add visitor support #1564

Merged
merged 7 commits into from
Oct 8, 2021
Merged

Add visitor support #1564

merged 7 commits into from
Oct 8, 2021

Conversation

nmanu1
Copy link
Contributor

@nmanu1 nmanu1 commented Oct 5, 2021

Accept visitor object in init and allow visitor to be set or changed using setVisitor. 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.

@coveralls
Copy link

coveralls commented Oct 5, 2021

Coverage Status

Coverage increased (+0.002%) to 61.229% when pulling 9a05670 on dev/visitor-support into bef0cc5 on develop.

src/answers-umd.js Outdated Show resolved Hide resolved
src/answers-umd.js Outdated Show resolved Hide resolved
@yen-tt
Copy link
Contributor

yen-tt commented Oct 7, 2021

should update answers-search-bar as well to support visitor

README.md Outdated Show resolved Hide resolved
src/answers-search-bar.js Outdated Show resolved Hide resolved
src/core/core.js Outdated Show resolved Hide resolved
@nmanu1 nmanu1 requested review from oshi97 and yen-tt October 7, 2021 21:14
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) {
Copy link
Member

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 });?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated!

@nmanu1 nmanu1 requested a review from cea2aj October 8, 2021 18:48
@nmanu1 nmanu1 merged commit 821736b into develop Oct 8, 2021
@nmanu1 nmanu1 mentioned this pull request Nov 16, 2021
nmanu1 added a commit that referenced this pull request Nov 16, 2021
## 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)
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.

None yet

5 participants