mod-build 3.4.13-beta.2 → 3.4.13-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/scripts/qs-form.js +23 -10
package/package.json
CHANGED
package/src/scripts/qs-form.js
CHANGED
|
@@ -422,6 +422,7 @@ modForm.initQSForm = function() {
|
|
|
422
422
|
this.opts.websiteName = window.location.host;
|
|
423
423
|
this.opts.resultsPage = (this.opts.resultsPage ? this.opts.resultsPage : '/my/results/');
|
|
424
424
|
this.opts.errorRedirectPath = (this.opts.errorRedirectPath ? this.opts.errorRedirectPath : '/my/results/');
|
|
425
|
+
this.opts.landingPage = window.location.hostname + window.location.pathname;
|
|
425
426
|
this.opts.quadLinkParams = {};
|
|
426
427
|
|
|
427
428
|
// We check if there's a quad link on the query string
|
|
@@ -679,8 +680,7 @@ modForm.processQSFormSubmitSuccess = function(response, xhr) {
|
|
|
679
680
|
|
|
680
681
|
// If submission was succesful
|
|
681
682
|
if (dataCaptureKey != null && xhr.status === 200) {
|
|
682
|
-
var clickKeyUUID = this.opts.formData.CLK
|
|
683
|
-
landingPage = window.location.hostname + window.location.pathname;
|
|
683
|
+
var clickKeyUUID = this.opts.formData.CLK;
|
|
684
684
|
|
|
685
685
|
// Setting GA User ID and several custom dimensions after a successful form submit request
|
|
686
686
|
if (typeof dataLayer !== 'undefined') {
|
|
@@ -706,7 +706,7 @@ modForm.processQSFormSubmitSuccess = function(response, xhr) {
|
|
|
706
706
|
// eslint-disable-next-line camelcase
|
|
707
707
|
project_id: dataCaptureKey,
|
|
708
708
|
// eslint-disable-next-line camelcase
|
|
709
|
-
form_path: landingPage,
|
|
709
|
+
form_path: this.opts.landingPage,
|
|
710
710
|
qsclickkey: clickKeyUUID
|
|
711
711
|
});
|
|
712
712
|
|
|
@@ -795,11 +795,24 @@ modForm.processQSFormSubmitSuccess = function(response, xhr) {
|
|
|
795
795
|
* @returns {Boolean}
|
|
796
796
|
*/
|
|
797
797
|
modForm.isQsSiteEligibleForHrc = function() {
|
|
798
|
-
var
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
798
|
+
var landingPage = this.opts.landingPage,
|
|
799
|
+
eligibleDomains = [
|
|
800
|
+
'modernize.local',
|
|
801
|
+
'qa.modernize.com',
|
|
802
|
+
'modernize.com'
|
|
803
|
+
],
|
|
804
|
+
nonEligiblePaths = [
|
|
805
|
+
'gutter-guards',
|
|
806
|
+
'home-warranty',
|
|
807
|
+
'home-security',
|
|
808
|
+
'medicalalerts',
|
|
809
|
+
'bathandshowerremodel'
|
|
810
|
+
];
|
|
811
|
+
|
|
812
|
+
var isEligible = (eligibleDomains.indexOf(this.getDefaultSiteByDomain()) > -1 &&
|
|
813
|
+
!nonEligiblePaths.some(function(path) {
|
|
814
|
+
return landingPage.indexOf(path) > -1;
|
|
815
|
+
}));
|
|
816
|
+
|
|
817
|
+
return isEligible;
|
|
805
818
|
};
|