Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Commit

Permalink
Populate olytics init component
Browse files Browse the repository at this point in the history
For some reason, the file was empty in the last PR
  • Loading branch information
zarathustra323 committed Apr 14, 2021
1 parent 14b4fd3 commit 239190c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/marko-web-omeda/components/olytics/init.marko
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<marko-web-deferred-script-loader-register
name="olytics"
src="https://olytics.omeda.com/olytics/js/v3/p/olytics.min.js"
on=input.on
request-frame=input.requestFrame
target-tag=input.targetTag
init=`if (!window.olytics) { window.olytics = []; window.olytics.oid = '${input.oid}'; window.olytics.factory = function(i) { return function() { var t = Array.prototype.slice.call(arguments); return t.unshift(i), window.olytics.push(t), window.olytics } }; window.olytics.fire = window.olytics.factory('fire'); window.olytics.confirm = window.olytics.factory('confirm'); }`
on-script-build="script.id = 'olyticsImport'; script.setAttribute('data-oid', window.olytics.oid);"
on-script-loaded="for (olytics.initialize({ Olytics: { oid: window.olytics.oid } }); window.olytics.length > 0;) { var o = window.olytics.shift(), s = o.shift(); olytics[s] && olytics[s].apply(olytics, o); }"
/>

0 comments on commit 239190c

Please sign in to comment.