New to Horizon? Learn more first.
| Host | Subdomain |
|---|---|
horizon.yourdomain.com | horizon.sailthru.com |
Horizon works best when it has content to suggest to your audience. There are multiple was to tell Horizon what content your site has to offer:
Horizon will crawl suggested pages input by you or found by the spider. Similar to search bots, Horizon's spider will observe particular meta tags to assist in determining the relevancy of an article to a given user. The Horizon JavaScript also measures content popularity by page view, further weighting content for use in Horizon-powered products.
<meta name="sailthru.date" content="Tue, 05 Apr 2011 23:26:57 -0400" /> <meta name="sailthru.title" content="Belichick named top coach in the NFL" /> <meta name="sailthru.tags" content="sports, football, nfl, new-england-patriots" />
For more on these tags, see meta tags.
Note: If you already have suitable meta tags in <title>, keywords and date, you don't need to do this.
The easiest process is to use the Concierge setup wizard while you're testing, and let the Javascript take care of things after you go live.
Using meta tags to block search engines or robots? You'll need to grant Sailthru's spider permission to crawl your site. Learn how on our meta tags page.
Copy the below code and replace the reference to horizon.example.com with the actual Horizon subdomain you have chosen.
Place the Javascript tracking code on every page on your site that you wish to track. The Javascript can be placed as late as possible on the page – right before the closing </body> tag is fine. Following snippet loads Horizon JavaScript in asynchronous / non-blocking way. This is the recommended approach for embedding horizon.
But sometimes, it may not work due to external JavaScript resources like: external ads, other tracking resources and so on during which you should use synchronous loading. (Refer to Synchronous Loading section below)
<!-- Sailthru Horizon --> <script type="text/javascript"> (function() { function loadHorizon() { var s = document.createElement('script'); s.type = 'text/javascript'; s.async = true; s.src = location.protocol + '//ak.sail-horizon.com/horizon/v1.js'; var x = document.getElementsByTagName('script')[0]; x.parentNode.insertBefore(s, x); } loadHorizon(); var oldOnLoad = window.onload; window.onload = function() { if (typeof oldOnLoad === 'function') { oldOnLoad(); } Sailthru.setup({ domain: 'horizon.example.com', }); }; })(); </script>
Sailthru.setup() invocation requires object literal as a single parameter.
| Parameter | Description | Example |
|---|---|---|
| domain | Horizon domain | horizon.example.com |
| Parameter | Description | Example | Default |
|---|---|---|---|
| spider | Set to false if the current page should not be spidered | true or false | true |
| concierge | Enable or disable concierge recommendation in the page. By default, it's false. If set as true, default concierge values will be used. Learn more about Concierge parameters | true or false or {threshold: 1200, delay: 500} | false |
| cookieDomain | Custom cookie domain if you don't want to use default location value window.location.host | domain.com | Existing domain of the page. For example: if the domain is www.sailthru.com, same value will be used as cookieDomain |
| Parameter | Description | Example | Default |
|---|---|---|---|
| tags | Use custom tags instead of page meta tags | sports, football | Extract sailthru.tags values from meta section of a HTML page if given else, use standard keywords tags values |
Sailthru.setup({ domain: 'horizon.example.com', concierge: { delay: 500, offsetBottom: 20, } });
<script type="text/javascript" src="http://ak.sail-horizon.com/horizon/v1.js"></script> <!-- if loading for secure domain, use: https://ak.sail-horizon.com/horizon/v1.js --> <script type="text/javascript"> $(function() { // Sailthru Concierge if (window.Sailthru) { Sailthru.setup({ domain: 'horizon.example.com' }); } }); </script>
Harness the full power of Horizon with on-site tools. You can learn more about setting them up below.