Skip to content

Commit

Permalink
Merge 20f6e22 into ad4a9ba
Browse files Browse the repository at this point in the history
  • Loading branch information
benmcginnis committed Jun 28, 2023
2 parents ad4a9ba + 20f6e22 commit aad5385
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 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.16.0",
"version": "1.16.1",
"description": "Javascript Search Programming Interface",
"main": "dist/answers-umd.js",
"repository": {
Expand Down
10 changes: 9 additions & 1 deletion src/core/utils/urlutils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { PRODUCTION, SANDBOX } from '../constants';
import { CloudRegion } from '@yext/search-core';
import { PRODUCTION, SANDBOX, CLOUD_REGION } from '../constants';
import SearchParams from '../../ui/dom/searchparams';
import StorageKeys from '../storage/storagekeys';
import ComponentTypes from '../../ui/components/componenttypes';
Expand All @@ -17,6 +18,9 @@ export function getLiveApiUrl (env = PRODUCTION) {
* @param {boolean} conversionTrackingEnabled If conversion tracking has been opted into.
*/
export function getAnalyticsUrl (env = PRODUCTION, conversionTrackingEnabled = false) {
if (isEu()) {
return 'https://www.eu.yextevents.com';
}
if (conversionTrackingEnabled) {
return env === SANDBOX
? 'https://sandbox-realtimeanalytics.yext.com'
Expand All @@ -27,6 +31,10 @@ export function getAnalyticsUrl (env = PRODUCTION, conversionTrackingEnabled = f
: 'https://answers.yext-pixel.com';
}

function isEu () {
return CLOUD_REGION.toLowerCase() === CloudRegion.EU.toString();
}

/**
* Returns the passed in url with the passed in params appended as query params
* Note: query parameters in the url are stripped, you should include those query parameters
Expand Down

0 comments on commit aad5385

Please sign in to comment.