Installing LeadDyno
In this article
Pre-Installation: Account Setup
Before installing LeadDyno, please sign up for an account here. Once you've signed up, you can access your public and private keys via Settings (Account Info section).
Installation
Installing LeadDyno for your site typically involves three simple steps:
- Installing Visitor Tracking;
- Configuring Lead Tracking;
- Adding Purchase Tracking.
With this guide, we will help you through each step. If you're ever stuck, please contact us. We are here to help you get set up, quickly and pain-free.
Visitor Tracking
To get visitor tracking setup, add the following code to the <body> section of each page on your website:
<script type="text/javascript" src="https://static.leaddyno.com/js"></script> <script> // If you use multiple sub-domains, set the root domain here // LeadDyno.domain = "yourdomain.com"; LeadDyno.key = "YOUR_PUBLIC_KEY" LeadDyno.recordVisit(); </script>
Replace "YOUR_PUBLIC_KEY" with the public key from the Settings (Account Info section). This will load the LeadDyno library and begin tracking where your visitors are coming from!
Note: This code should be on every page of your website, similar to Google Analytics.
Lead Tracking
Your next step in your LeadDyno setup is to capture the email address of your visitors since an email address is required in order to track affiliate referrals for your purchases. In order for our system to pick up the first&last name during lead submission, you need to ensure that their IDs are first_name and last_name.
There are three different ways to do this:
Option 1: AutoWatch
The easiest way to track leads is to use the autoWatch()
function, which will automatically watch all inputs on your site for a lead email. To enable this, simply add the following code to the LeadDyno tracking script:
LeadDyno.autoWatch();
Option 2: Watch
Alternatively, if you are familiar with jQuery, you can use selectors to tell LeadDyno to watch particular inputs for a lead email:
LeadDyno.watch("#email"); // will watch fields with the ID 'email'
Option 3: Record Lead
If you want more control over when the lead email is captured, you can use the recordLead()
function in your own client site event listeners (e.g. on a form.submit () event handler): PayPal or Stripe )
$('#my-form').submit(function(){ LeadDyno.recordLead($("#email").val()); });
Your LeadDyno code
After adding the domain, your public key, and the lead tracking function to the LeadDyno code, here is how your code should look:
<script type="text/javascript" src="https://static.leaddyno.com/js"></script> <script> LeadDyno.domain = "yourdomain.com"; LeadDyno.key = "1234567890" LeadDyno.recordVisit(); LeadDyno.autoWatch(); </script>
In case your LeadDyno code has a different structure, or if you're stuck on any of the steps above, please contact us at support@leaddyno.com so that we can lend a helping hand.
Purchase Tracking
Next up is purchase tracking, and it can be done in one of three ways:
- Using a purchase tracking integration (e.g. PayPal or Stripe);
- Using the LeadDyno REST API;
- Using the LeadDyno Javascript Library.
Option 1: Using Integrations
If you are using a billing system that we integrate with, purchase tracking is very simple: a link to documentation for supported integrations is in the left sidebar of every Help Center guide.
Option 2: The REST API
If you are not using one of the systems we integrate with, the next option is to use LeadDyno’s REST API.
You will issue POST
and DELETE
requests to the http://api.leaddyno.com/v1/purchases
URL to create and cancel purchases, respectively.
Additional parameters and documentation can be found in the Purchases API docs.
If all of this sounds foreign to you, don't panic. We're here to help. Simply contact us and we'll help you navigate your setup with ease.
Option 3: Using Javascript
Your final option is to track purchases via the Javascript library. You can do this by adding the following javascript code to the ‘Thank You’ page after a user has purchased:
LeadDyno.recordPurchase("john@example.com", { purchase_amount: "12345" });
and, to record cancellations, invoke the following javascript:
LeadDyno.recordCancellation();
As always, we are here to help. Contact us at any time and we'll help you get started!