Skip to content

Instantly share code, notes, and snippets.

View leadbi's full-sized avatar

LeadBI leadbi

View GitHub Profile
@leadbi
leadbi / leadbi_email_placeholders.md
Last active November 20, 2017 13:44 — forked from andrei-tofan/leadbi_email_placeholders.md
LeadBI Email Automation Placeholders

LeadBI Email Automation Placeholders

Placeholders allows you to create personalized emails content and urls.

Usage

[[placeholder_name]] - will be replaced with the value of the placeholder.

Available Placeholders

Contact

  • [[first_name]]
  • [[last_name]]
@leadbi
leadbi / leadbi_native_forms.md
Last active May 26, 2017 06:24 — forked from andrei-tofan/leadbi_native_forms.md
LeadBI Native Forms Integration

LeadBI Native Forms Integration

LeadBI Native Forms allows you to capture data from existing website forms.

Target a specific form

To target a specific form you need to specify an html5 id associated with the form, by not specifying it leadbi will try to capture all forms from the page.

Form Attributes

  • Email - any input with the text 'email' in the name field or any input with the attribute data-leadbi-email="true"
  • Full Name - any input with the text 'full?name' in the name field or any input with the attribute data-leadbi-full-name="true"
@leadbi
leadbi / private_area.js
Last active April 1, 2021 11:28 — forked from andrei-tofan/private_area.js
LeadBI user identification api
// check if $leadbi_website api is available
if(window.$leadbi_website){
// fetch user object of the current visitor
window.$leadbi_website.getCurrentUser(function (err, user) {
// call the identify api
// calling this method multiple times for the same email address will not create duplicate contacts
return user.identify({
@leadbi
leadbi / leadbi_api.md
Created May 5, 2017 11:47 — forked from andrei-tofan/leadbi_api.md
LeadBI API access documentation

LeadBI API Access

In order to access the leadbi api you need to create a api key in the account section. After the api key is created you can make api calls using the following headers:

  • X-Access-Id - api key id
  • X-Access-Secret - api key secret

Request Example

GET /api/v1/websites
Host: app.leadbi.com
@leadbi
leadbi / ninja-forms.js
Created May 5, 2017 11:48 — forked from andrei-tofan/ninja-forms.js
Ninja Forms JavaScript Hook
var form_id = 3;
// listen to all ajax completed events
jQuery(document).ajaxComplete(function (event, jqXHR, ajaxOptions) {
// try to parse response
var data = JSON.parse(jqXHR.responseText || '{}');
// check if the ajax request is for our form
if (data.data.form_id == form_id) {
@leadbi
leadbi / leadbi_native_form.html
Last active July 23, 2020 05:32 — forked from andrei-tofan/leadbi_native_form.js
LeadBI Native Form Integration
<!--
HTML Integration
Capture form data without javascript (html only)
More documentation: https://gist.github.com/leadbi/a458eb881007c800c045cabfd98ac8af
-->
<!-- the form id is used to capture data only from specific forms -->
<form id="optional-id">
<input type="text" name="firstname"><br>
<input type="text" name="lastname">
@leadbi
leadbi / leadbi_tracking_fields.md
Created May 11, 2017 12:52
LeadBI Tracking Fields

LeadBI Tracking Fields

This is a list of fields that can be used to send data from email campaigns to leadbi.

Example

https://www.leadbi.com/?utm_email=hi@leadbi.com&utm_firstname=Andrei&utm_lastname=Example

Fields

Contact Fields:

@leadbi
leadbi / leadbi_webhook_data.md
Last active May 23, 2017 07:51
LeadBI Automation Webhook Data

LeadBI Automation Webhook Data

When webhooks are used inside an automation, the engine will replace all email placeholders in the url and make a POST request with the content type application/json containing the following data:

// sample data
{
    // contact
    id: 121324,
@leadbi
leadbi / api_calls.md
Created September 7, 2017 14:20
LeadBI API Calls
// account
'/api/v1/account': ['GET', 'PUT'],
'/api/v1/account/usage': ['GET'],
'/api/v1/account/invoices': ['GET'],
'/api/v1/account/invoices/([0-9]+)/download': ['GET'],

// integrations
'/app/integrations/mailchimp/authorize': ['GET'],
'/app/integrations/mailchimp/callback': ['GET'],
@leadbi
leadbi / SwiftMTA.php
Last active September 14, 2017 12:21
Swift MTA Simple Logs API
<?php // SwiftMTA.php
class SwiftMTALogsCursor {
/**
* Create result cursor
*/
public function __construct($api, $query, $result, $limit, $offset){
$this->api = $api;
$this->limit = $limit;