Skip to content

Commit

Permalink
Merge 28324a9 into 530f4bd
Browse files Browse the repository at this point in the history
  • Loading branch information
tmeyer2115 committed Dec 12, 2022
2 parents 530f4bd + 28324a9 commit c188f2b
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yext/answers-search-ui",
"version": "1.15.1",
"version": "1.15.2",
"description": "Javascript Search Programming Interface",
"main": "dist/answers-umd.js",
"repository": {
Expand Down
3 changes: 1 addition & 2 deletions src/core/analytics/analyticsreporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,7 @@ export default class AnalyticsReporter {
ytag('optin', true);
cookieData = ytag('yfpc', null);
} else if (this._conversionTrackingEnabled) {
console.error('Tried to enable conversion tracking without including ytag');
return false;
console.error('Conversion Tracking is enabled without supplying ytag. Analytics event sent without Conversion Tracking info.');
}

if (!(event instanceof AnalyticsEvent)) {
Expand Down
4 changes: 2 additions & 2 deletions tests/core/analytics/analyticsreporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ describe('reporting events', () => {
it('logs a console error if opted in and ytag missing', () => {
analyticsReporter.setConversionTrackingEnabled(true);
const consoleErrorSpy = jest.spyOn(console, 'error');
expect(analyticsReporter.report(new AnalyticsEvent('thumbs_up'))).toBeFalsy();
expect(consoleErrorSpy).toHaveBeenLastCalledWith('Tried to enable conversion tracking without including ytag');
expect(analyticsReporter.report(new AnalyticsEvent('thumbs_up'))).toBeTruthy();
expect(consoleErrorSpy).toHaveBeenLastCalledWith('Conversion Tracking is enabled without supplying ytag. Analytics event sent without Conversion Tracking info.');
});

it('includes cookies if opted in and ytag present', () => {
Expand Down

0 comments on commit c188f2b

Please sign in to comment.