Web Troubleshooting
Browser Support
- The Branch Web 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.
Chrome | Firefox | Safari | IE |
---|---|---|---|
✔ | ✔ | ✔ | 9, 10, 11 |
Bower or Npm Compatibility
- Use
bower install branch-sdk
ornpm install branch-sdk
CommonJS and RequireJS Compatibility
- Add
require('branch')
ordefine(['branch'], function(branch) { ... });
Branch init Options
- Properties which you can pass within
branch.initSession()
- Used for Initialize Branch features
Key | Value | Type | Required |
---|---|---|---|
branch_match_id | The current user's browser-fingerprint-id. The value of this parameter should be the same as the value of ?branch_match_id (automatically appended by Branch after a link click). _Only necessary if ?_branch_match_id is lost due to multiple redirects in your flow. | string | N |
branch_view_id | If you would like to test how Journeys render on your page before activating them, you can set the value of this parameter to the id of the view you are testing. Only necessary when testing a view related to a Journey. | string | N |
no_journeys | When true, prevents Journeys from appearing on current page. | boolean | N |
disable_entry_animation | When true, prevents a Journeys entry animation. | boolean | N |
disable_exit_animation | When true, prevents a Journeys exit animation. | boolean | N |
open_app | Whether to try to open the app passively through Journeys (as opposed to opening it upon user clicking); defaults to false. | boolean | N |
nonce | A nonce value that will be included on any script or style tags Branch adds to your site. Used to allowlist these tags in your Content Security Policy. | string | N |
Testing Read Deep Link
- Used for Read deep link
- Make a deep link redirect to your website
https://example.app.link/kJNbhZ1PrF?$fallback_url=https://example.com
- Website will open to $fallback_url with
_branch_match_id
https://example.app.link/kJNbhZ1PrF?$fallback_url=https://www.website.com/&_branch_match_id=418480444086051524
- Read
_branch_match_id
from that$fallback_url
website
branch.init('key_live_YOUR_KEY_GOES_HERE', function(err, data) {
console.log(err, data);
});
Journey not Sticking to Nav
- Navigate to Dashboard Journey Page
- Select Journey -> Edit -> Configure Views -> Banner -> Page Placement
- Banner Scroll =
sticky
- Press
Save & Close
- Add the following div to your nav
<div class="branch-journeys-top"></div>
Create Call to Action
- (Deprecated) Recommend to use Share deep link instead
<a href="#" onclick="branch.deepviewCta()">deep link</a>
<button onclick="branch.deepviewCta()">deep link</button>
var linkData = {
campaign: String(Date.now())
};
var linkOptions = {
make_new_link: false, // don't create a new deep link if one already exists (e.g. _branch_match_id is in the address bar)
open_app: true // will attempt to open the app if install (URI Scheme deep linking only - will not work with Safari)
};
branch.deepview(linkData, linkOptions, function(err, data) {
console.log(err, data);
});
No Access-Control Error
- Make sure the Branch key is the same within the deep link and website
XMLHttpRequest cannot load https://api2.branch.io/v1/open. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access. The response had HTTP status code 400.
Browser Fingerprint ID
- In case you need to access your user's Browser Fingerprint ID for user deletion, use the function below.
branch.getBrowserFingerprintId(function(err, data) { console.log(data); });
Content Security Policy Violations
- Generate a dynamic nonce value, and include that value as a
script-src
andstyle-src
exception within your Content Security Policy - Pass that same value to
branch.init()
branch.init(YOUR_BRANCH_KEY, {'nonce': 'GENERATED_NONCE_VALUE' });
Updated 4 months ago