mirror of
https://github.com/stancl/tenancy-docs.git
synced 2025-12-12 02:04:03 +00:00
wip
This commit is contained in:
parent
30eb0794b5
commit
09f6c5d0c0
1 changed files with 21 additions and 6 deletions
|
|
@ -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'));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue