This commit is contained in:
Samuel Štancl 2021-11-29 20:11:10 +01:00
parent 30eb0794b5
commit 09f6c5d0c0

View file

@ -1,10 +1,25 @@
import splitbee from '@splitbee/web'; import splitbee from '@splitbee/web';
splitbee.init({ (function (tag) {
scriptUrl: "https://tenancyforlaravel.com/bee.js", if (! tag) {
apiUrl: "https://tenancyforlaravel.com/_hive", return;
}) }
let tag = document.getElementsByClassName('extsb')[0]; let data = tag.dataset;
if (! data.token) {
return;
}
splitbee.user.set({test: 'foo'}) splitbee.init({
scriptUrl: "https://tenancyforlaravel.com/bee.js",
apiUrl: "https://tenancyforlaravel.com/_hive",
token: data.token,
})
splitbee.enableCookie();
splitbee.user.set({github: data.github});
splitbee.track('Purchase', {
product: data.product,
price: data.price,
});
})(document.getElementById('extsb'));