H5 contents DK
Introduction
First, you need to introduce the adsTag script in the head area
<script>
window.adsTag = window.adsTag || { cmd: [] };
</script>
<script
id="ads-tag-sdk"
data-site-id="site_11"
data-utm-source="channel-id"
src="https://sdk.beesads.com/v1/ads-tag.js">
</script>
IMPORTANT: Please load the script from https://sdk.beesads.com/v1/ads-tag.js, do not localize the script!
Parameter Description
id
string
The current script's identifier, fixed value: ads-tag-sdk
yes
data-site-id
string
Domain name unique identifier, provided by the administrator
yes
data-utm-source
string
Channel ID, which has a higher weight than utm_source in the URL parameter
no
data-test
string
Whether to enable test mode. When the value is on, the test mode will be turned on. Special attention should be paid to not use it in a formal environment!
no
src
string
SDK address, fixed value: https://sdk.beesads.com/v1/ads-tag.js
yes
use
Direct call
window.adsTag.renderAds(document.querySelector('#test-one'), 300, 250, zoneId);
Call using cmd
If you cannot confirm whether adsTag has been loaded when using it, it is recommended to use cmd method to call it. If async is used in the script, this method must be used.
Note: Please do not use const { adsTag } = window; method to obtain adsTag.
window.adsTag.cmd.push(function (){
window.adsTag.renderAds(document.querySelector('#test-one'), 300, 250, zoneId);
});
initialization
window.adsTag.init({
// Whether to enable fixed width, the default value is false, it is recommended to use the default value to achieve higher benefits
fixedWidth: true
});
Last updated