mod-build 3.4.13-beta.1 → 3.4.13-beta.2
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 +8 -7
package/package.json
CHANGED
package/src/scripts/qs-form.js
CHANGED
|
@@ -672,12 +672,14 @@ modForm.submitFormDataToQSApi = function(formData, successCallback, errorCallbac
|
|
|
672
672
|
*/
|
|
673
673
|
modForm.processQSFormSubmitSuccess = function(response, xhr) {
|
|
674
674
|
var cookieData,
|
|
675
|
-
responseData = response.RESPONSE
|
|
675
|
+
responseData = response.RESPONSE,
|
|
676
|
+
dataCaptureKey = responseData.DCK;
|
|
677
|
+
|
|
678
|
+
window.projectId = responseData.HASHEDDCK;
|
|
676
679
|
|
|
677
680
|
// If submission was succesful
|
|
678
|
-
if (
|
|
679
|
-
var
|
|
680
|
-
clickKeyUUID = this.opts.formData.CLK,
|
|
681
|
+
if (dataCaptureKey != null && xhr.status === 200) {
|
|
682
|
+
var clickKeyUUID = this.opts.formData.CLK,
|
|
681
683
|
landingPage = window.location.hostname + window.location.pathname;
|
|
682
684
|
|
|
683
685
|
// Setting GA User ID and several custom dimensions after a successful form submit request
|
|
@@ -758,10 +760,9 @@ modForm.processQSFormSubmitSuccess = function(response, xhr) {
|
|
|
758
760
|
|
|
759
761
|
// Set results page to HRC if the site is eligible, there's a DCK
|
|
760
762
|
// and the results page opt is not defined yet (emerging trades have results page defined and should not redirect to the HRC)
|
|
761
|
-
if (this.isQsSiteEligibleForHrc() &&
|
|
762
|
-
window.projectId = response.RESPONSE.HASHEDDCK;
|
|
763
|
+
if (this.isQsSiteEligibleForHrc() && window.projectId && !this.opts.resultsPage) {
|
|
763
764
|
this.opts.resultsPage = this.getProjExUrl();
|
|
764
|
-
this.opts.resultsPage += (this.opts.resultsPage.indexOf('?') < 0 ? '?' : '&') + 'DCK=' +
|
|
765
|
+
this.opts.resultsPage += (this.opts.resultsPage.indexOf('?') < 0 ? '?' : '&') + 'DCK=' + dataCaptureKey;
|
|
765
766
|
}
|
|
766
767
|
|
|
767
768
|
// Append TY to HRC URL for QS tracking purpose
|