sourcebuster
Version:
Get sources of your site's visitors (utm / organic / referral / typein).
285 lines (277 loc) • 11.3 kB
HTML
<html>
<head>
<meta charset="utf-8" />
<title>Sourcebuster JS ™</title><!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="css/sourcebuster.min.css" rel="stylesheet" />
<script src="js/sourcebuster.min.js?v=1.0.5"></script>
</head>
<body>
<section id="wrapper">
<header>
<h1>
Sourcebuster JS
</h1>
</header>
<section id="src-links">
<a href="http://www.alexfedoseev.com/post/40/sourcebuster-js" target="_blank">About</a> · <a href="https://github.com/alexfedoseev/sourcebuster-js" target="_blank">GitHub</a> · <a href="https://github.com/alexfedoseev/sourcebuster-js/archive/master.zip">Download from GitHub</a>
</section>
<table>
<tr>
<td width="350">
<h3>
First visit
</h3>
</td>
<td width="350">
<h3>
Current visit
</h3>
</td>
</tr>
<tr>
<td>
<table>
<tr>
<td class="sb-table-param-type">
Type:
</td>
<td class="sb-table-param-value" id="sb_first_typ"></td>
</tr>
<tr>
<td class="sb-table-param-type">
utm_source:
</td>
<td class="sb-table-param-value" id="sb_first_src"></td>
</tr>
<tr>
<td class="sb-table-param-type">
utm_medium:
</td>
<td class="sb-table-param-value" id="sb_first_mdm"></td>
</tr>
<tr>
<td class="sb-table-param-type">
utm_campaign:
</td>
<td class="sb-table-param-value" id="sb_first_cmp"></td>
</tr>
<tr>
<td class="sb-table-param-type">
utm_content:
</td>
<td class="sb-table-param-value" id="sb_first_cnt"></td>
</tr>
<tr>
<td class="sb-table-param-type">
utm_term:
</td>
<td class="sb-table-param-value" id="sb_first_trm"></td>
</tr>
</table>
</td>
<td>
<table>
<tr>
<td class="sb-table-param-type">
Type:
</td>
<td class="sb-table-param-value" id="sb_current_typ"></td>
</tr>
<tr>
<td class="sb-table-param-type">
utm_source:
</td>
<td class="sb-table-param-value" id="sb_current_src"></td>
</tr>
<tr>
<td class="sb-table-param-type">
utm_medium:
</td>
<td class="sb-table-param-value" id="sb_current_mdm"></td>
</tr>
<tr>
<td class="sb-table-param-type">
utm_campaign:
</td>
<td class="sb-table-param-value" id="sb_current_cmp"></td>
</tr>
<tr>
<td class="sb-table-param-type">
utm_content:
</td>
<td class="sb-table-param-value" id="sb_current_cnt"></td>
</tr>
<tr>
<td class="sb-table-param-type">
utm_term:
</td>
<td class="sb-table-param-value" id="sb_current_trm"></td>
</tr>
</table>
</td>
</tr>
</table>
<table>
<tr>
<td colspan="2">
<table>
<tr>
<td class="sb-table-param-add-type">
First visit date:
</td>
<td class="sb-table-param-add-value" id="sb_first_add_fd"></td>
</tr>
<tr>
<td class="sb-table-param-add-type">
First entrance point:
</td>
<td class="sb-table-param-add-value" id="sb_first_add_ep"></td>
</tr>
<tr>
<td class="sb-table-param-add-type">
First referer:
</td>
<td class="sb-table-param-add-value" id="sb_first_add_rf"></td>
</tr>
<tr>
<td class="sb-table-param-add-type">
Current visit date:
</td>
<td class="sb-table-param-add-value" id="sb_current_add_fd"></td>
</tr>
<tr>
<td class="sb-table-param-add-type">
Current entrance point:
</td>
<td class="sb-table-param-add-value" id="sb_current_add_ep"></td>
</tr>
<tr>
<td class="sb-table-param-add-type">
Current referer:
</td>
<td class="sb-table-param-add-value" id="sb_current_add_rf"></td>
</tr>
<tr>
<td class="sb-table-param-add-type">
Pages seen:
</td>
<td class="sb-table-param-add-value" id="sb_session_pgs"></td>
</tr>
<tr>
<td class="sb-table-param-add-type">
Current page:
</td>
<td class="sb-table-param-add-value" id="sb_session_cpg"></td>
</tr>
<tr>
<td class="sb-table-param-add-type">
Visits:
</td>
<td class="sb-table-param-add-value" id="sb_udata_vst"></td>
</tr>
<tr>
<td class="sb-table-param-add-type">
IP:
</td>
<td class="sb-table-param-add-value" id="sb_udata_uip"></td>
</tr>
<tr>
<td class="sb-table-param-add-type">
User agent:
</td>
<td class="sb-table-param-add-value" id="sb_udata_uag"></td>
</tr>
<tr>
<td class="sb-table-param-add-type">
Promocode:
</td>
<td class="sb-table-param-add-value" id="sb_promo_code"></td>
</tr>
</table>
</td>
</tr>
</table>
<script>
sbjs.init({
lifetime: 3,
domain: {
host: 'statica.alexfedoseev.com',
isolate: true
},
referrals: [
{
host: 'plus.url.google.com',
display: 'plus.google.com :)'
}
],
custom_campaign: 'my_adwords_campaign',
promocode: true,
callback: placeData
});
function placeData(sb) {
document.getElementById('sb_first_typ').innerHTML = sb.first.typ;
document.getElementById('sb_first_src').innerHTML = sb.first.src;
document.getElementById('sb_first_mdm').innerHTML = sb.first.mdm;
document.getElementById('sb_first_cmp').innerHTML = sb.first.cmp;
document.getElementById('sb_first_cnt').innerHTML = sb.first.cnt;
document.getElementById('sb_first_trm').innerHTML = sb.first.trm;
document.getElementById('sb_current_typ').innerHTML = sb.current.typ;
document.getElementById('sb_current_src').innerHTML = sb.current.src;
document.getElementById('sb_current_mdm').innerHTML = sb.current.mdm;
document.getElementById('sb_current_cmp').innerHTML = sb.current.cmp;
document.getElementById('sb_current_cnt').innerHTML = sb.current.cnt;
document.getElementById('sb_current_trm').innerHTML = sb.current.trm;
document.getElementById('sb_first_add_fd').innerHTML = sb.first_add.fd;
document.getElementById('sb_first_add_ep').innerHTML = sb.first_add.ep;
document.getElementById('sb_first_add_rf').innerHTML = sb.first_add.rf;
document.getElementById('sb_current_add_fd').innerHTML = sb.current_add.fd;
document.getElementById('sb_current_add_ep').innerHTML = sb.current_add.ep;
document.getElementById('sb_current_add_rf').innerHTML = sb.current_add.rf;
document.getElementById('sb_session_pgs').innerHTML = sb.session.pgs;
document.getElementById('sb_session_cpg').innerHTML = sb.session.cpg;
document.getElementById('sb_udata_vst').innerHTML = sb.udata.vst;
document.getElementById('sb_udata_uip').innerHTML = sb.udata.uip;
document.getElementById('sb_udata_uag').innerHTML = sb.udata.uag;
document.getElementById('sb_promo_code').innerHTML = sb.promo.code;
}
</script>
<section id="info">
<h2>
Test Links
</h2>
<h3>
UTM
</h3>
<p>
<a href="?utm_source=yandex&utm_medium=cpc&utm_campaign=y_test_sourcebuster_js&utm_term=sourcebuster_js_yandex_keyword или просто ключ яндекса">?utm_source=yandex&utm_medium=cpc&utm_campaign=y_test_sourcebuster_js...</a><br /><a href="?utm_source=google&utm_medium=cpc&utm_campaign=g_test_sourcebuster_js&utm_term=sourcebuster_js_google_keyword или просто ключ гугла">?utm_source=google&utm_medium=cpc&utm_campaign=g_test_sourcebuster_js...</a>
</p>
<h3>
Organic
</h3>
<p>
<a href="https://www.google.ru/search?q=statica+alexfedoseev+sourcebuster-js">Google</a> · <a href="http://yandex.ru/yandsearch?lr=213&text=statica+alexfedoseev+sourcebuster+js">Yandex</a> · <a href="http://search.aol.com/aol/search?enabled_terms=&s_it=comsearch&q=statica+alexfedoseev+sourcebuster+js">AOL (predefined)</a> · <a href="http://nova.rambler.ru/search?utm_source=nhp&query=statica+alexfedoseev+sourcebuster+js&btnG=%D0%9D%D0%B0%D0%B9%D1%82%D0%B8">Rambler (custom)</a>
</p>
<h3>
Referral
</h3>
<p>
<a href="http://alexfedoseev.livejournal.com/86404.html">livejournal.com</a> · <a href="http://www.alexfedoseev.com/post/40/sourcebuster-js">alexfedoseev.com</a>
</p>
<h3>
Referral Custom
</h3>
<p>
<a href="https://twitter.com/alexfedoseev/status/481686942820478976">Twitter</a> · <a href="https://plus.google.com/+%D0%9B%D1%91%D1%88%D0%B0%D0%A4%D0%B5%D0%B4%D0%BE%D1%81%D0%B5%D0%B5%D0%B2/posts/e1NqiXSquPo">Google+</a>
</p>
</section>
</section>
<footer>
<p>
</p>
</footer>
</body>
</html>