$ git clone https://github.com/wanderBee/adshare-jssdk
$ yarn
$ yarn build
<script src="https://cdn.jsdelivr.net/npm/adshare-jssdk@0.3.1/dist/launchAd.min.js"></script>
import LaunchAd from "adshare-jssdk";
prepare
login in dsp platform for advertising settings
in your file
/**
* 初始化initConfig 尽量保证被最先加载
* 比如 html 引入,可放到 </head> 上方
*/
LaunchAd.initConfig({
async: true // 是否异步执行js api
noIframe: false // 是否跳出iframe,true则跳出;默认为false 页面被嵌入到iframe中
});
/**
* 转化收益上报
* @param uuid [String][必传] 分发用户标识
* @param phone [String][必传] 转化手机号
* @param actionId [String][非必传] // 转化ID (dsp platform配置)
*/
LaunchAd.report({
uuid: "",
actionId: "",
phone: ""
});