Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
arajguha committed Aug 6, 2021
1 parent e1f7d92 commit e19305a
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions integrations/Qualtrics/browser.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable new-cap */
/* eslint-disable no-empty */
/* eslint-disable no-unneeded-ternary */
/* eslint-disable class-methods-use-this */
Expand Down Expand Up @@ -66,19 +67,29 @@ class Qualtrics {
}

page(rudderElement) {
const { name, category, properties } = rudderElement.message;
const categoryField = category
? category
: properties && properties.category
? properties.category
: undefined;
logger.debug("===in Qualtrics page===");
const { message } = rudderElement;
if (!message) {
logger.debug("Message field is missing");
return;
}

if (this.enableGenericPageTitle) {
window._qsie.push("viewed a page");
return;
}

const { name, category, properties } = message;
const categoryField = category
? category
: properties && properties.category
? properties.category
: null;

if (!categoryField && !name) {
logger.debug("No name or category field found");
logger.debug(
"generic title is disabled and no name or category field found"
);
return;
}
const dynamicTitle =
Expand All @@ -90,6 +101,7 @@ class Qualtrics {
}

track(rudderElement) {
logger.debug("===in Qualtrics track===");
const { message } = rudderElement;
if (!message) {
logger.debug("Message field is missing");
Expand Down

0 comments on commit e19305a

Please sign in to comment.