)
In the next guide, we will learn how to pull to AnyTrack the details of the leads like Name, Email, or phone number.
❗️This is a really good hack as the more values you send from AnyTrack to Facebook the higher match rate that your event will get. Also, sending facebook the events with the details like Email will help for the advanced matching.
Requirements:
1. you should use HTML lead generation in order to follow this guide.
2. Having our tag on the same page
How to start collecting leads value in the javascript event code?
1. we need to go to the HTML form.
2. Look for <form> tag, it should be at the start of the HTML form:
3. Look for the end of the tag (after the action and the other strings) :
4. Paste this part there:
onsubmit="AnyTrack('trigger','Lead',{firstName:this.X.value,
lastName:this.X.value,phone:this.X.value,email:this.X.value })"
and this will be the results:
<form action="/action_page.php" onsubmit="AnyTrack('trigger','Lead',
{firstName:this.X.value,lastName:this.X.value,
phone:this.X.value,email:this.X.value })">
5. The last part is to change the red X to the names that appear in your HTML inputs :
So for example, if my HTML looks like this:
<form action="/action_page.php" onsubmit="AnyTrack('trigger','Lead',
{firstName:this.X.value,lastName:this.X.value,
phone:this.X.value,email:this.X.value })">
<label for="fname">First name:</label><br>
<input type="text" name="fname" ><br>
<label for="lname">Last name:</label><br>
<input type="text" name="lname" ><br>
<label for="lname">phone number:</label><br>
<input type="text" name="phoneNumber" ><br>
<label for="lname">Email:</label><br>
<input type="text" name="email" ><br><br>
<input type="submit" value="Submit">
</form>
After settings the values instead of the X it will look like this:
<form action="/action_page.php" onsubmit="AnyTrack('trigger','Lead',
{firstName:this.fname.value,lastName:this.lname.value,
phone:this.phoneNumber.value,email:this.email.value })">
<label for="fname">First name:</label><br>
<input type="text" name="fname" ><br>
<label for="lname">Last name:</label><br>
<input type="text" name="lname" ><br>
<label for="lname">phone number:</label><br>
<input type="text" name="phoneNumber" ><br>
<label for="lname">Email:</label><br>
<input type="text" name="email" ><br><br>
<input type="submit" value="Submit">
</form>
That's it! 🎉
Now after submitting a lead, you will be able to see it in AnyTrack:
Do you collect the full name in one input?
No problem, just use the next code instead of the given one on step 4:
onsubmit="AnyTrack('trigger','Lead',{name:this.X.value,
phone:this.X.value,email:this.X.value })"
Comments
0 comments
Please sign in to leave a comment.