Not able to pass email in results page url?


#1

Hi Nik,

Just wondering if it’s possible to pass email via exit url, on results page, like this:

https://example.com?email={email}

I’m guessing ‘no’, because of privacy issues, etc.

But, if I want to connect 2 decision trees together, so the data collected is accessible by the other, I want to pass the email via exit URL of the 1st DT.

I can do it via cookie or localStorage. But, I’m just wondering if there’s a better way, using LH functionality.

Cheers,
Wynne


#2

I’m not sure if this is the easiest method, or not. But, I was able to script something up to do it:

On the first decision tree, run this script in node, after email is collected:

// find index of email field
fieldIndex;
for (var i = 0; i < inputArray.length; i++) {
	if (inputArray[i].name === "email") {
		fieldIndex = i;
		break;
	}
}

// store email in localStorage
localStorage.setItem('tempEmail', inputArray[fieldIndex].value);

Then, on 2nd node, retrieve email and store in email custom field. Then, delete email from custom storage, to avoid any privacy concerns:

// find index of email field
var fieldIndex;
for (var i = 0; i < inputArray.length; i++) {
	if (inputArray[i].name === "email") {
		fieldIndex = i;
		break;
	}
}

// retrieve email value
var tempEmail = localStorage.getItem('tempEmail');

// store email in custom field
inputArray[fieldIndex].value = tempEmail;

// delete email from localStorage
localStorage.removeItem('tempEmail');

#3

Hi @Wynne_Pirini,

Yes you can.

Nik


#4

Thanks Nik.

Yes, I’ve read through the knowledgebase article. And I have everything else working correctly, except email.

When I pass parameter - email={email} - via URL, the value is empty (but all of the other entries are populated).


#5

Hi @Wynne_Pirini,

Please send your Decision Tree url to help @ leadshook dot com and I’ll have a look. Should work without any issues.

Nik


#6

@Wynne_Pirini,

I can only think of one thing…

You’re collecting email in the LAST node and redirecting in that node.

If YES, then do this…

Last Node (where email is captured) => Results Page Node (add an immediate redirect in this node).
This extra step buys a few extra milliseconds for email to be saved and called from DB.

Nik


#7

OK thanks Nik.

I just sent a support ticket.

Cheers,
Wynne