-
Notifications
You must be signed in to change notification settings - Fork 1
/
referring1.html
55 lines (47 loc) · 2.1 KB
/
referring1.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html>
<head>
<script>
(function(b,r,a,n,c,h,_,s,d,k){if(!b[n]||!b[n]._q){for(;s<_.length;)c(h,_[s++]);d=r.createElement(a);d.async=1;d.src="https://cdn.branch.io/branch-latest.min.js";k=r.getElementsByTagName(a)[0];k.parentNode.insertBefore(d,k);b[n]=h}})(window,document,"script","branch",function(b,r){b[r]=function(){b._q.push([r,arguments])}},{_q:[],_v:1},"addListener applyCode autoAppIndex banner closeBanner closeJourney creditHistory credits data deepview deepviewCta first getCode init link logout redeem referrals removeListener sendSMS setBranchViewData setIdentity track validateCode trackCommerceEvent".split(" "), 0);
branch.init('key_live_fgtTc91nFdH5rvTKT3ms4gbdqqaRmDAz', function(err, data) {
console.log("branch data: " + JSON.stringify(data));
document.getElementById('branchData').innerHTML = JSON.stringify(data);
document.getElementById('nextSiteWithIdButton').href = "https://jgilhuly.github.io/referring2.html?_branch_match_id=" + getParameterByName("_branch_match_id");
});
branch.deepview({
channel: 'referring1',
data: {
'site': 'referring1'
},
feature: 'dashboard',
tags: [ 'referring1' ],
},
{
make_new_link: false
},
function(err) {
console.log(err || 'no error');
});
function deeplink() {
console.log("deepviewCta");
branch.deepviewCta();
}
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}
</script>
</head>
<body>
<h1>Referring Page 1<h1>
<p id="branchData">Branch data goes here.</p>
<button id="deeplinkButton" onclick="deeplink()">Deeplink Me!</button>
<a id="nextSiteButton" href="https://jgilhuly.github.io/referring2.html">Next Site!</a>
<a id="nextSiteWithIdButton">Next Site with Data!</a>
</body>
</html>