What does it do?
The Lead Capture Script grabs the information submitted by the user on the landing page form or Drift chatbot and sends it to the platform. The lead's information can be found in the Converted Lead table. This script is designed to work only with landing pages of "Lead Generation" campaigns. The landing page should be set up within the Metadata's Campaign Wizard that includes field mapping. Email is the required field.
Before starting:
- Lead Capture Script will grab all fields from the form that are mapped in the metadata landing page offer.
- Does the script contain any cookies? Yes, the cookie is not unique to the person but is unique to the Metadata campaign, allowing us to associate the lead with the campaign they completed the form for.
- For landing pages with a Drift chatbot, the script will only grab the email address when a User enters it during the chatbot journey.
- Ensure the Lead Capture Script is installed on the landing page with the form and it works properly. Without this, converted leads information will not get pushed to the platform.
- Our Lead Capture Script out of the box doesn't work with iframes. Please reach out to support if you are using an iframe on your landing page.
- Event pages such as Zoom, on24.com, Calendly are not supported. A workaround is to create a Lead Gen Form offer and link directly to the event form.
How does it look?
You can copy the metadata tracking code by going here and clicking settings for Metadata App and clicking copy for the Lead Capture script
<script> (function(options) { var s = document.createElement("script"); s.async = true; s.src = "https://cdn.metadata.io/site-script.js"; s.onload = function() { window.Metadata.siteScript.init(options); }; document.head.appendChild(s); })({ accountId: ACCOUNT_ID }); </script>
How to embed it?
The Metadata tracking code should be embedded into the Landing page directly or via any Tag Manager across all pages or the specific landing page you plan to run Landing Page campaigns.
Facebook Campaign Landing Pages
It is very important to verify your domain for where you plan to run Facebook Landing Page campaigns. For instructions, please see: here.
Manually Trigger Lead Capture Script:
Depending on the landing page, in some scenarios, our Site Script can be manually triggered if a custom form is being used that is not triggering on submit.
- The site script will need to be inserted into the landing page and be present to trigger our API script which is contained inside the .js file.
- When testing, the metadata_cid will need to be present in the URL. As a test, you can manually insert the metadata_cid into your URL, e.g. metadata.io/?metadata_cid=1234.
- If you open the console and enter Metadata.siteScript you can start interacting with the Site Script.
- To send data from a form, use window.Metadata.siteScript.sendFormData(formEl), where formEl is the form DOM element. For raw data, use: window.Metadata.siteScript.sendData({email: 'test@test.com'})
- Debugging: Use window.Metadata.siteScript.getAllFields() to show all form fields the site script is aware of.
Thank You Page Ad Channel Tracking Pixel:
For Landing Page campaigns, the conversion pixel needs to be placed on the thank you page after a lead converts so that conversions can be tracked in the Social channels.
Are cookies used?
Cookie name |
Description / Usage |
Expiration |
Provenance |
---|---|---|---|
Metadata_cid |
Stores in the cookie the metadata_cid (unique campaign ID from metadata).
Used for conversion tracking purposes to see where the Lead originally originated from after clicking an Ad from a Metadata campaign.
|
30 mins |
Third-party |
Site Visitors Pixel:
For more information, please read All about: Site Visitors Pixel.
Help and Support: Please email support@metadata.io if you're running into any issues.
Comments
0 comments
Article is closed for comments.