常見問題解答,操作概覽與入門指南。

Live price widgets

BullionVault’s live price widget shows the current buy and sell price for gold, silver and platinum from our Zurich vault. You will determine which currency, metal and weight units are shown by default in your widget. Your users will then be able to choose which display options they would like to see. Your referral id can be added into the code for the widgets.

There are four widget sizes for you to choose from:

  • 728x90
  • 250x250
  • 120x240
  • 160x600

You may also be interested in embedding the BullionVault gold, silver, platinum and palladium chart on to your website. Like the price widget, it's highly customisable, with referral tracking incorporated in the code. While we endeavour to provide a reliable and accurate service, BullionVault makes no guarantees of the stability of the price charts or widgets or the accuracy of the data they provide.

The below explains how to add the widgets to your website and lists all the available configuration options that can be used to customize the widget. If you have any problems with embedding the widget please contact us at referrals@BullionVault.com.

Loading the live price widget

The referrer banner library is written in javascript and is hosted on BullionVault‘s server. There is no need to download the library to any other server. Just add the following script tag into the head element of the page you want to embed the live price widget into.

	
	<!doctype html>
	<head>
		<script src="https://www.bullionvault.com/banners/live_price_widget.js?v=1"></script>
	</head>
	
	

Displaying the price widget

The live price widget is added by calling the new BullionVaultPriceWidget(...) with two arguments. The first argument is the ID of the DOM element the live price widget should embed into. This can be a DIV or any other block element. The second argument is an object containing configuration options. All available options are listed below.

	
	<div id="bannerContainer"></div>

	<script>
		var options = {bullion: 'gold'};
		new BullionVaultPriceWidget('bannerContainer', options);
	</script>
	
	

Live price widget initialization options

referrerID Your referrerID will be your BullionVault username. i.e. if your username is JOHNSMITH101, you should enter this as your referrerID.
Accepted values: Your BullionVault username, e.g. 'MYUSERNAME'
size Selects which size banner to load.
Accepted values: '728x90', '250x250', '120x240', or '160x600'
bullion Selects the bullion type to display.
Accepted values: 'gold', 'silver' or 'platinum'
currency Selects the currency which should be displayed.
Accepted values: 'USD', 'GBP', or 'EUR'
weightUnit Selects which units to display the prices in - per KG or per troy ounce.
Accepted values: 'KG', or 'TOZ'

Example of use


<html>
	<head>
		<script src="https://www.bullionvault.com/banners/live_price_widget.js"></script>
	</head>

	<body>

	<div id="banner1"></div>

	<script type="text/javascript">
		var options = {
			referrerID: "JOHNSMITH101",
			size: "250x250",
			bullion: "gold",
			currency: "EUR",
			weightUnit: "TOZ"
		};
		new BullionVaultPriceWidget('banner1', options);
	</script>

	</body>
</html>