Web Basic Integration
SDK Stats
Open Source Github Repo: https://github.com/BranchMetrics/web-branch-deep-linking
SDK Size: 50kb
Speed: Median 80ms to 250ms
iOS 14 Intelligent Tracking Prevention Warning
On iOS 14 in Safari, you likely will see 'branch.io' listed as blocked by Safari with the new visibility. Note that this is expected, and simply means that cookies from branch.io are blocked. No web functionality or tracking will be affected. We use a different domain for managing our cookies.
์๊ตฌ ์ฌํญ
This SDK requires native browser Javascript and has been tested in all modern browsers with sessionStorage capability. No 3rd party libraries are needed to make use of the SDK as is it 100% native Javascript.
Browser Specific Support
Chrome | Firefox | Safari | IE |
---|---|---|---|
โ | โ | โ | 9, 10, 11 |
Configure Branch
- Configure the default link settings for your app

Initialize Branch
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title></title>
<script>
// load Branch
(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 logEvent disableTracking qrCode".split(" "), 0);
// init Branch
branch.init('key_live_YOUR_KEY_GOES_HERE');
</script>
</head>
<body></body>
</html>
- Apply script to the
<Head/>
element of the HTML - Change
key_live_YOUR_KEY_GOES_HERE
to match your Branch Dashboard - If you'd like to use a specific version of the SDK, point to https://cdn.branch.io/branch-x.xx.x.min.js (e.g. https://cdn.branch.io/branch-2.47.1.min.js) rather than https://cdn.branch.io/branch-latest.min.js when initializing.
Escaped Keys & Values
Journeys link data (data returned from Journeys event handlers) in WebSDK versions <= 2.48.0 will now contain escaped keys and values. Characters targeted for escaping include ", ', &, <, and >. These characters will be escaped to their corresponding HTML entities. Additionally URLs, in both keys and values will be URI encoded.
Developers using WebSDK >= 2.49 will notice values in Journeys link data become escaped with the same rules as above. Keys will not be escaped.
Updated 4 months ago