Connecting Unbounce to LeadByte
Many of our clients collect leads using third party landing page software, like Unbounce (which is awesome by the way!). This article aims to show you what you need to do in Unbounce and what you need to do in LeadByte to make sure both systems are talking (so you are receiving your leads).
This article covers:
- Posting leads to LeadByte (Form Post & Webhook)
- Capturing URL parameters as hidden fields (like SID, SSID, FBCLID, GCLID)
Posting Leads - Two Methods
1. POST Form Data
2. Web Hook (recommended)
POST Form Data
Step 1 - I have created my form in Unbounce, how do I post data to LeadByte?
The first thing you need to do is edit your Unbounce landing page and select the form so the form properties side-bar appears (as per below). Under Form Confirmation you need to select "Post form data to a URL" and tick "Append form data to URL".
The URL you enter should be your LeadByte campaign integration URL, for example: https://INSERT.leadbyte.co.uk/api/submit.php?returnjson=yes&campid=INSERT
TIP: Make sure you do not have anything in the UnBounce WebHook setup as this will cause the POST data to double up and it will not work with LeadByte
Step 2 - Understanding what happens when a form is completed by a visitor
Once you have done the above, you need to publish your landing page. When the form is completed, Unbounce will post the form data to the URL you have entered into the text box above and append the form data you are collecting into the post request (example post below). This replaces the thank you page that you would usually see in Unbounce so you will need to correct this (see Step 3 below).
Example Post
https://INSERT.leadbyte.co.uk/api/submit.php?returnjson=yes&campid=INSERT&first_name=Anthony&last_name=Burgin&email=anthonyburgin%40gmail.com&insurancetype=Health&pageid=5551a82a-b43b-44c1-8399-a45f210bcaea&pagevariant=a
Unbounce automatically append the pageid AND page variant, you can add each as an additional field on your LeadByte campaign if you want to save them. Furthermore, when you add additional fields to your Unbounce form, you have the option use the auto-generated field name (which would be posted to LeadByte) or set your own (see below). To receive this data, please ensure the field exists in LeadByte.
Step 3 - Create LeadByte redirects on campaign
When the form is completed on Unbounce AND you have added to the form the option "Post form data to URL" the visitor will see a LeadByte response code. This will not mean much to the visitor so we advise you redirect the visitor to a "Thank You" page. The Thank You page can be controlled by you from LeadByte by adding a redirect URL into the campaign under Redirects.
When you select Create Redirects against the LeadByte campaign you can enter in what the visitor is redirected to after they submit the form. You can enter in a different URL for different outcomes using rules OR keep it really simple and redirect a visitor to a URL based on a Success, Dupe or Error (see below). We would advise that you create a page in Unbounce to redirect to.
Any questions or problems please do reach out to your account manager. We have live working examples of this in action at time of this article being published.
Web Hook (recommended)
Within your UnBounce Page you have a Tab called "Webhooks". This is where you will add the URL to post the Form Data and map your fields.
Step 1
Create a REST API Key in LeadByte with the permission to CREATE a Lead. We advise that you create a key specifically for UnBounce. You create a REST API Key under Admin > Tech Hub > REST API.
Step 2
- Add the following URL to UnBounce and map the fields.
Be sure that you are using the correct LeadByte domain extension for your account i.e. co.uk or .com
- The first INSERT value is your account name.
- The second INSERT value is your LeadByte REST Key from Step 1.
- The third INSERT value is your Campaign Reference in LeadByte
Please ensure the fields are the same as per your LeadByte campaign else it will not work.
URL
https://INSERT.leadbyte.co.uk/restapi/v1.2/unbounce?key=INSERT&campid=INSERT
It's worth noting that the "preview page" function doesn't fire your webhook. So test this set-up on your published page to ensure it works.
Capturing SID as hidden field
This article covers the principles of how to track where your leads have come from i.e. Facebook, Google. For UnBounce, you can take your pick (option 1, 2 or 3). Below covers 2 and 3, which are the methods we recommend.
SID URL Parameter Tracking
This will require you to create SID as a hidden field (with a default value) and make sure your Ad links include the SID URL parameter. URL parameters also enable you to pass attribution data into every lead such as UTM parameters, FBCLID, GCLID, AdSet, AdName and more.
Why is this important? Capturing SID enables you to see where your leads have come from i.e. Facebook, Google. Capturing additional values such as Adset, AdName will enable you to track revenue back to the ads that you run. If you generate leads by working with Suppliers (affiliates, publishers) you should use SID to track performance.
Example URL structure:
Lets assume in LeadByte that the Supplier Facebook is SID 4. This would be an example of your URL in your Facebook Ads https://www.MyDomain.com/?sid=4&ssid=Ad1
How to capture hidden fields with UnBounce
Firstly, Read this article:
https://documentation.unbounce.com/hc/en-us/articles/360001198863-Passing-URL-Parameters-Through-a-Form
Tip:
When you add SID as Hidden Field, make sure that you enter in a default SID value. If the SID is dropped from the URL (it happens) then the default value will always be used (as a backup). Your LeadByte account automatically creates you (account owner) as a Supplier with the SID value of “1”. You would enter 1 into the Default value against the SID Hidden field in UnBounce.
Automatically capture the referrer (Facebook, Google)
This requires you to add JavaScript (example below) to your UnBounce page so please ensure you know what you are doing. Here are the Steps:
1. Create Suppliers in LeadByte (read more here)
2. Add hidden field to UnBounce (SID)
3. Map SID > SID in WebHook in UnBounce
4. Add Script to UnBounce (script to map referrer to SID)
5. TEST
Script
In the example below, if traffic comes from Google it is stored as SID "1".
If it comes from Facebook, it is "2" else it is "3"
<script>
var referrer = document.referrer;
document.getElementById('referrer').value = referrer;
console.log(referrer);
if (referrer.includes('google')) { //Google
var sid = 1;
document.getElementById('sid').value = sid;
}
else if (referrer.includes('facebook') || referrer.includes('instagram')) { //Facebook/Instagram
var sid = 2;
} else {
var sid = 3
document.getElementById('sid').value = sid;
}
console.log(sid);
</script>
Comments