Skip to content

Commit

Permalink
fix(INT-523): replaced flag with dropdown for datacenter selection (#…
Browse files Browse the repository at this point in the history
…1367)

added dropdown new option to select datacenter
  • Loading branch information
anantjain45823 authored Sep 15, 2023
1 parent 2f2c3ff commit d63755b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/integrations/CustomerIO/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class CustomerIO {
this.siteID = config.siteID;
this.apiKey = config.apiKey;
this.datacenterEU = config.datacenterEU;
this.datacenter = config.datacenter;
this.sendPageNameInSDK = config.sendPageNameInSDK;
this.name = NAME;
({
Expand All @@ -24,15 +25,15 @@ class CustomerIO {

init() {
logger.debug('===in init Customer IO init===');
const { siteID, datacenterEU } = this;
loadNativeSdk(siteID, datacenterEU);
const { siteID, datacenter, datacenterEU } = this;
loadNativeSdk(siteID, datacenter, datacenterEU);
}

identify(rudderElement) {
logger.debug('in Customer IO identify');
const { userId, context } = rudderElement.message;
const { traits } = context || {};
if(!userId){
if (!userId) {
logger.error('userId is required for Identify call.');
return;
}
Expand Down
4 changes: 2 additions & 2 deletions src/integrations/CustomerIO/nativeSdkLoader.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { LOAD_ORIGIN } from '../../utils/ScriptLoader';

function loadNativeSdk(siteID, datacenterEU) {
function loadNativeSdk(siteID, datacenter, datacenterEU) {
window._cio = window._cio || [];
(function () {
let a;
Expand All @@ -22,7 +22,7 @@ function loadNativeSdk(siteID, datacenterEU) {
t.id = 'cio-tracker';
t.setAttribute('data-site-id', siteID);
t.src = 'https://assets.customer.io/assets/track.js';
if (datacenterEU === true) {
if (datacenter === 'EU' || datacenterEU === true) {
t.src = 'https://assets.customer.io/assets/track-eu.js';
}
s.parentNode.insertBefore(t, s);
Expand Down

0 comments on commit d63755b

Please sign in to comment.