Embedding our systems in your content site
During the creation of your content website, you will need to implement the different elements of our system.
When dealing with onboarding and client cabinet element, you can choose to use our widgets, or create your own interface and communicate with our servers via API calls.
Are you building your site with Wordpress? Download the attached plugin and install it for easier implementation via simple shortcode.
Embedded widgets
In order to embed our widgets, please first add the following code to the page HEAD section:
<script src="https://bpw.brand.com/BPWidgets/embed/widgets-iframe.js"></script>
Then add the following script to the page in the location you would like the widget to show:
<div id="bpwidgets"></div>
<script type="text/javascript">
bpApp({
apiHost: 'https://bpw.brand.com',
themeSet: 'default',
lang: 'en',
state: 'wowMain.login',
redirectSuccess: 'https://www.brand.com/trade',
redirectFailure: 'https://www.brand.com/',
}).render( '#bpwidgets');
</script>
Parameters -
apiHost: 'https://bpw.brand.com', - change “brand.com” with your own brand domain. (keep same across all site)
themeSet: 'default', - specify your themeSet, leave empty for default.
lang: 'en', - specify for different languages, leave empty for default
state: 'wowMain.login',- change state based on the needed widget
redirectSuccess: 'https://www.brand.com/trade', - choose where you would like to redirect your user after submission
redirectFailure: 'https://www.brand.com/', - choose where you would like to redirect the user if submission failed.
Affiliates should link to your web pages with their affiliate ID via the a_aid parameter.
For example: https://www.brand.com/?a_aid=123456Please
add the following code to the page HEAD section to support the a_aid parameter:
<script type="text/javascript" src="https://d2vl6u6wrj3tgq.cloudfront.net/assets/v5/js/json2.js"></script>
<script type="text/javascript" src="https://d2vl6u6wrj3tgq.cloudfront.net/assets/v5/js/promos-cookies-2.js"></script>
Embedded WowFX / WowCrypto platform
In order to embed our FX/CFD platform, please first add the following code to the page HEAD section:
<script src="https://fx-trading.brand.com/bpFxCfd/embed/bpfxcfd-iframe.js"></script>
Then add the following script to the page in the location you would like the platform to show:
<div id="bpfxcfd"></div>
<script type="text/javascript">
tsApp({
apiHost: 'https://fx-trading.brand.com',
themeSet: 'default',
lang: 'en'
}).render( '#bpfxcfd');
</script>
To fully embed the platform into different height of pages, you will need to write a script that will calculate the height of the div.
You can use the code we wrote as a reference only for what you should do as it is implemented in the below URL:
fx.tradesmarter.cn/bpFxCfd/embed/example-iframe.html
# Very Important - Copy and pasting this code will not work for you as each content site is different than the other.
(you should obviously replace the "fx.tradesmarter.cn" with "fx-trading.yourbrand.com" in your own script.
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>Trading</title>
<link id="dynamic-favicon" href="" rel="shortcut icon">
<script src="https://fx.tradesmarter.cn/bpFxCfd/embed/bpfxcfd-iframe.js"></script>
</head>
<body style="margin: 0; padding: 0">
<h1 id="header">Embed Example</h1>
<div id="bpfxcfd"></div>
<script type="text/javascript">
const headerElement = document.getElementById('header');
const totalHeight = window.innerHeight;
const style = window.getComputedStyle ? getComputedStyle(headerElement, null) : headerElement.currentStyle;
const marginTop = parseInt(style.marginTop) || 0;
const marginBottom = parseInt(style.marginBottom) || 0;
const totalMargin = marginTop + marginBottom;
const headerHeight = headerElement.offsetHeight + totalMargin;
const embedHeight = totalHeight - headerHeight - 1;
document.getElementById('bpfxcfd').style.height = embedHeight + 'px';
tsApp({
apiHost: 'https://fx.tradesmarter.cn',
themeSet: 'default',
// lang: 'en',
}).render( '#bpfxcfd');
</script>
</body>
</html>
Embedded WowOptions Platform
In order to embed our options platform, please add the following code to the page in the location you would like the platform to show:
<script type="text/javascript">
window.__apiHost = "https://trading.brand.com";
window.__lang = "en";
window.__hideHeader = true;
</script>
<script src="https://trading.brand.com/app-angular-platform/embed/wow.js"></script>