Getting Started

In order to collect user behavior data from your website, you first need to place a snippet of code into each of your pages. We'll immediately begin collecting general analytics data, such as page views and session lengths.

Paste the Brytescore 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 -->

Hook Up Your Visitor Registrations and Logins

When a user registers on your site, you should log the action with the registeredAccount event. When a registered user logs into your 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.

Below is an example user registration event. See the Core Objects & Events for details on the userAccount object and registration 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);

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 user's Brytescore will be. Brytescore supports a large variety of real estate and normal events, as listed in Core Objects & Events and Real Estate Package.

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);

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 can be used for one or more of the following purposes inside the Lead Booster products:

  • Reporting: Drives charts in your reporting dashboards. If these events are not tracked, some of your reports will be missing or incomplete.
  • Scoring: Adds 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 Gen: 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.

The table below should help you prioritize which events should be tracked by your system. If your system does not have an event marked as required, please contact us for support.

Event Reporting Scoring Lead Gen
authenticated
realestate.deletedSavedListing
realestate.listingImpression
pageView
registeredAccount
realestate.savedListing
realestate.savedSearch
realestate.searchedAgents
realestate.searchedListings
realestate.searchedOffices
realestate.subscribedSearch
updatedUserInfo
realestate.viewedListing
realestate.viewedListingPhoto
realestate.printedDrivingDirections
realestate.printedListing
realestate.printedListingFlyer
realestate.requestedCMA
realestate.requestedHomeAppraisal
realestate.requestedInfo
realestate.requestedShowing
realestate.sharedListingEmail
realestate.sharedListingFacebook
realestate.sharedListingTwitter
realestate.submittedAgentContactForm
submittedForm
realestate.subscribedListingUpdates
realestate.viewedAgentProfile
realestate.viewedDrivingDirections
realestate.viewedOfficeProfile
realestate.viewedSavedSearch

Which Object 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 Brytescore API, begin at the Lead Booster API Overview.