Quick Start

Quick Start

The Lead Booster Analytics API captures the real estate activities of users on your web site or mobile app, all in real-time. The Lead Booster Analytics API docs will show you how to use the official client libraries.

Your code will send activity events via HTTP POSTs to the API server. To avoid any potential bottlenecks, the server will only return 200 OK responses when a POST is successfully received. To see if your events are validating and logging correctly, make sure to visit the Developer Dashboard.

The Lead Booster Analytics API has several official libraries to help you call the API endpoints without dealing with the details of the REST HTTP calls. We highly recommend you use the library for your preferred language, rather than access the API directly. Pick your preferred platform from the above list of official libraries to see examples for each topic.

Import your preferred library

In order to collect user behavior data from your website, you first need to import the proper library into your project or web page. Lead Booster will immediately begin collecting general analytics data, such as page/screen views and session lengths.

Use the examples on the right to learn how to import the proper library based on the platform you are using.

Paste the Lead Booster Analytics snippet into your pages

Copy and paste this code into your site header, inside the HEAD section of each page. This can usually be performed inside a server-side include or templating engine partial. Replace YOUR_API_KEY with your own key.

<!-- Brytescore -->
<script>
	(function(a,c,g,e,d,f,b){e[d]=e[d]||function(){(e[d].q = e[d].q || []).push( arguments )};e[d].t=1*new Date();
	b=a.getElementsByTagName( c )[0];f=a.createElement(c);f.async=1;f.src=g;b.parentNode.insertBefore(f,b)})
	(document,"script","https://cdn.brytecore.com/brytescore.js/brytescore.min.js",window,"brytescore");
	brytescore("setAPIKey","YOUR_API_KEY");
	brytescore("pageView",{});
	brytescore("load","https://cdn.brytecore.com/packages/realestate/package.json");
</script>
<!-- End Brytescore -->

Installation

The brytescore-ios library can be added to your iOS application. It is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "BrytescoreAPI"

Initialization

Sets the API key. Generates a new unique session ID. Retrieves the saved user ID, if any.

let _apiManager = BrytescoreAPIManager(apiKey: "YOUR_API_KEY")

Installation

The brytescore-android library can be added to your Android application. To install it, clone the brytescore repo and simply add the brytescore folder to your project's directory. Then add the following line to your app's build.gradle:

compile project(path: ':brytescore')

Initialization

Sets the API key. Generates a new unique session ID. Retrieves the saved user ID, if any.

brytescore = new Brytescore(getApplicationContext(), "YOUR_API_KEY");

Hook Up Registrations and Logins

When a user registers with your app or web site, you should log the action with the registeredAccount event. When a registered user logs into your app or site, you should use the authenticated event. Remember to place these events wherever a user can register or authenticate, such as login pages or popover windows.

Don't forget to authenticate a user when they log in via cookie or remembered session! If you have a "Remember Me" feature, it should trigger authenticate on session start.

Below is an example user registration event. See Core Objects & Events for details on the userAccount object and registeredUser event.

/* Example user registration event. */

// Create an object to store the user data you wish to track.
var data = {
	"userAccount" : {
		"id": "123456",
		"email": "revenge@florin.com",
		"firstName": "Inigo",
		"lastName": "Montoya"
	},
	"isLead": true
};

// Call the registered event
brytescore("registeredAccount", data);

Below is an example user registration event. See Core Objects & Events for details on the userAccount object and registeredUser event.

/* Example user registration event. */

// Create an object to store the user data you wish to track.
let data = [
	"userAccount": [
		"id": 123456,
		"email": "revenge@florin.com",
		"firstName": "Inigo",
		"lastName": "Montoya"
	],
	"isLead": true
] as [String : AnyObject]

// Call the registered event
_apiManager.registeredAccount(data: data)

Below is an example user registration event. See Core Objects & Events for details on the userAccount object and registeredUser event.

/* Example user registration event. */

// Create an object to store the user data you wish to track.
final HashMap userAccount = new HashMap() {{
	put("id", 123456);
	put("email", "revenge@florin.com");
	put("firstName", "Inigo");
	put("lastName", "Montoya");
}};

HashMap data = new HashMap() {{
	put("userAccount", userAccount);
	put("isLead", true);
}};

// Call the registered event
brytescore.registeredAccount(data);

Log Real Estate Events

As a user performs activities on your site, you should track them with the brytescore function. The more activities you track, the more accurate the Lead Booster algorithms will be. Lead Booster supports a large variety of real estate and normal events, as listed in Real Estate Objects and Events.

As a general rule, if your app or web site has a feature related to real estate, you should be tracking it with Lead Booster Analytics. If you're looking for some guidance for prioritizing these tracked events, see the next section, Which Events Should You Track?.

Below is an example of a viewedListing real estate event. When the user is shown the details of a listing, the website tracks many details about the listing, in addition to the event itself.

/* Example listing view event. */

// Create an object to store the data you wish to track.
var data = {
	"listing": {
		"price": 349000,
		"mlsId": "2983599",
		"address": {
			"streetAddress": "196 Humperdink Lane",
			"city": "Florin City",
			"stateProvince": "Florin",
			"postalCode": "00990"
		},
		"geoLocation": {
			"latitude": "33.859821",
			"longitude": "-84.168221"
		},
		"photoURL": "http://images.yoursite.com/2983599_1.jpg",
		"listingURL": "http://www.yoursite.com/listings/2983599/",
		"fullBaths": 3,
		"halfBaths": 1,
		"bedrooms": 4,
		"subdivision": "Buttercup Rise",
		"features": [
			"Master on main",
			"Hardwood floors",
			"Fireplace",
			"Level lot",
			"Deck/Patio",
			"Fenced yard",
			"Garage: 3 car or more",
			"Garage: attached"
		]
	}
};

// Call the viewed_listing event
brytescore("realestate.viewedListing", data);

Below is an example of a viewedListing real estate event. When the user is shown the details of a listing, the website tracks many details about the listing, in addition to the event itself.

/* Example listing view event. */

// Create an object to store the data you wish to track.
let data = [
	"listing": [
		"price": 349000,
		"mlsId": "2983599",
		"address": [
			"streetAddress": "196 Humperdink Lane",
			"city": "Florin City",
			"stateProvince": "Florin",
			"postalCode": "00990"
		],
		"geoLocation": [
			"latitude": "33.859821",
			"longitude": "-84.168221"
		],
		"photoURL": "http://images.yoursite.com/2983599_1.jpg",
		"listingURL": "http://www.yoursite.com/listings/2983599/",
		"fullBaths": 3,
		"halfBaths": 1,
		"bedrooms": 4,
		"subdivision": "Buttercup Rise",
		"features": [
			"Master on main",
			"Hardwood floors",
			"Fireplace",
			"Level lot",
			"Deck/Patio",
			"Fenced yard",
			"Garage: 3 car or more",
			"Garage: attached"
		]
	]
] as [String : AnyObject]

// Call the viewed_listing event
_apiManager.brytescore(property: "realestate.viewedListing", data: data);

Below is an example of a viewedListing real estate event. When the user is shown the details of a listing, the website tracks many details about the listing, in addition to the event itself.

/* Example listing view event. */

// Create an object to store the data you wish to track.
HashMap<String, Object> address = new HashMap<String, Object>() {{
	put("street_address", "196 Humperdink Lane");
	put("city", "Florin City");
	put("state_province", "Florin");
	put("postal_code", "00990");
}};

HashMap<String, String> geoLocation = new HashMap<String, String>() {{
	put("latitude", "33.859821");
	put("longitude", "-84.168221");
}};

List<String> features = new ArrayList<String>() {{
	add("Master on main");
	add("Hardwood floors");
	add("Fireplace");
	add("Level lot");
	add("Deck/Patio");
	add("Fenced yard");
	add("Garage: 3 car or more");
	add("Garage: attached");
}};

HashMap<String, Object> listing = new HashMap<String, Object>() {{
	put("price", 349000);
	put("mls_id", "2983599");
	put("address", address);
	put("geoLocation", geoLocation);
	put("photoURL", "http://images.yoursite.com/2983599_1.jpg");
	put("listingURL", "http://www.yoursite.com/listings/2983599/");
	put("fullBaths", 3);
	put("halfBaths", 1);
	put("bedrooms", 4);
	put("subdivision", "Buttercup Rise");
	put("features", features);
}};

HashMap<String, Object> data = new HashMap<String, Object>() {{
	put("listing", listing);
}};

// Call the viewed_listing event
brytescore.brytescore("realestate.viewedListing", data);

Which Events Should You Track?

Generally, you should track every event that your website or system supports. Your analytics dashboards and user profiles will be more accurate and interesting if you track all of your events.

Events are tracked for specific purposes and each has its use. Events can be used for reporting, for lead scoring and profiling, or for generating leads to be sent to your agents.

You may want to focus on lead-generating events first, to ensure all leads get captured and pushed into Lead Booster. If you are not using the lead routing features of Lead Booster, this may not be a priority, and you may want to focus on which events are used for reporting app and site activity for your brokerage and marketing teams.

Reporting Events

These events drive the charts in your reporting dashboards. If these events are not tracked, some of your reports will be missing or incomplete.

Scoring Events

These events add data used by the Lead Booster machine learning algorithms to understand lead personas and aggregated information, such as target neighborhood and price. Without these events, the accuracy of predictions and behavior thresholds may suffer.

Lead-Generating Events

These events create new leads that can be assigned to agents. Without these events, you may not capture all situations where a lead may expect to be contacted by an agent.

Which Properties Should You Track?

Many events expect an object as one of the parameters. Similar to event tracking, you should track every property on objects that your system supports. This section should help you prioritize which object parameters you should provide.

listing
  • address (an address object)
  • bedrooms
  • features (an array of strings, ex: ["master on main", "fireplace", "level lot"])
  • fullBaths
  • geoLocation (a geo object)
  • halfBaths
  • isCondo
  • isForeclosure
  • isLot
  • isMultiFamily
  • isRental
  • isSingleFamily
  • listingURL
  • mlsId
  • photoURL
  • price
address
  • streetAddress
  • streetAddress2 (null if unavailable)
  • city
  • stateProvince
  • zipPostal
  • country
geo
  • latitude (ex: 33.859821)
  • longitude (ex: -84.168221)
search

Note these are parameters passed by the user when performing a search. As such, none are required, because the user may not pass any parameters at all, or only a few. Send us what the user searches for.

  • address (an address object, ex: {"state":"RI"} when searching only for properties in Rhode Island)
  • bedroomsMin
  • bedroomsMax
  • cities (an array of strings, ex: ["Cape Cod", "Boston"])
  • counties (an array of strings, ex: ["Barnstable"])
  • features (an array of string values of features that the user checked in their search, ex: ["Beach", "1 Car Garage", "Bungalow"])
  • fullBathsMax
  • fullBathsMin
  • halfBathsMax
  • halfBathsMin
  • isCondo
  • isForeclosure
  • isLot
  • isMultiFamily
  • isRental
  • isSingleFamily
  • mlsIds (an array of strings, ex: ["1118198"])
  • postalCodes (an array of strings, ex: ["02840", "02891"])
  • priceMax
  • priceMin
  • resultsCount (the number of matching search results)
  • searchURL
  • yearBuiltMax
  • yearBuiltMin
realEstateForm

Note that these fields will vary by form - send what you have.

  • agentName
  • fromEmail
  • fromName
  • fromTelephone (a telephone object)
  • isPrequalified
  • isWorkingWithAgent
  • message
  • name
  • relatedListing (a listing object)
  • subject
  • toEmail
  • toName
telephone

Note that this can include more than one number, but only one number of each type.

  • mobile
  • home
  • work
  • fax
  • direct

Further Reading

That's the end of the Quick Start guide. For more in-depth discussion of the Lead Booster Analytics API, begin at the Lead Booster Analytics API Overview.

Technical Support

For help implementing the Lead Booster Analytics API, please reach out to support@brytecore.com.

Lead Booster customers get free programmer support when implementing the Analytics API. To learn more about how Lead Booster can help your team close more leads, visit the Lead Booster product page on brytecore.com.