Skip to content

Commit

Permalink
solve merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
FentPams committed Aug 20, 2024
1 parent 7553799 commit 822b48b
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions plugins/experimentation/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,25 +79,6 @@ export function toClassName(name) {
* @param {string} result - the URL of the served experience.
*/
function fireRUM(type, config, pluginOptions, result) {
<<<<<<< HEAD
const sampleData = {
experiment: {
source: config.id,
target: result ? config.selectedVariant : config.variantNames[0],
},
campaign: {
source: result ? toClassName(config.selectedCampaign) : 'default',
target: Object.keys(pluginOptions.audiences).join(":"),
},
audience: {
source: result ? toClassName(config.selectedAudience) : 'default',
target: Object.keys(pluginOptions.audiences).join(":"),
},
};

const rumType = type === "experiment" ? "experiment" : "audience";
window.hlx?.rum?.sampleRUM(rumType, sampleData[type]);
=======
const { selectedCampaign = 'default', selectedAudience = 'default' } = config;

const typeHandlers = {
Expand All @@ -118,7 +99,6 @@ function fireRUM(type, config, pluginOptions, result) {
const { source, target } = typeHandlers[type]();
const rumType = type === 'experiment' ? 'experiment' : 'audience';
window.hlx?.rum?.sampleRUM(rumType, { source, target });
>>>>>>> 97e67b7207ab00e95c47651061c2cceac4d007d9
}

/**
Expand Down Expand Up @@ -400,12 +380,8 @@ function createModificationsHandler(
// Firing RUM event early since redirection will stop the rest of the JS execution
fireRUM(type, config, pluginOptions, url);
window.location.replace(url);
<<<<<<< HEAD
return null;
=======
// eslint-disable-next-line consistent-return
return;
>>>>>>> 97e67b7207ab00e95c47651061c2cceac4d007d9
}
// eslint-disable-next-line no-await-in-loop
res = await replaceInner(new URL(url, window.location.origin).pathname, el);
Expand Down

0 comments on commit 822b48b

Please sign in to comment.