Web Basic Integration

Current SDK Version 2.52.5

Please see the Web SDK Version History to view change log.

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

Initialize Branch

<!doctype html>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
    // 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".split(" "), 0);
    // init Branch

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 6 days ago

Web Basic Integration

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.