Install
Get Swishjam setup on your website
Install Swishjam
Place the following javasript snippet in the footer of your website
<script>
(() => { function t(e) { return t = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { return typeof t } : function (t) { return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t }, t(e) } function e(t, e) { var n = Object.keys(t); if (Object.getOwnPropertySymbols) { var r = Object.getOwnPropertySymbols(t); e && (r = r.filter((function (e) { return Object.getOwnPropertyDescriptor(t, e).enumerable }))), n.push.apply(n, r) } return n } function n(t) { for (var n = 1; n < arguments.length; n++) { var i = null != arguments[n] ? arguments[n] : {}; n % 2 ? e(Object(i), !0).forEach((function (e) { r(t, e, i[e]) })) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(i)) : e(Object(i)).forEach((function (e) { Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(i, e)) })) } return t } function r(e, n, r) { return (n = function (e) { var n = function (e, n) { if ("object" !== t(e) || null === e) return e; var r = e[Symbol.toPrimitive]; if (void 0 !== r) { var i = r.call(e, "string"); if ("object" !== t(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value.") } return String(e) }(e); return "symbol" === t(n) ? n : String(n) }(n)) in e ? Object.defineProperty(e, n, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[n] = r, e } !function (t, e) { var r = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, i = [], o = []; window.Swishjam = window.Swishjam || {}, window.Swishjam.stubbed = !0, window.Swishjam.init = function () { return console.warn("SwishjamJS not loaded yet, cannot call `init`.") }, window.Swishjam.getSession = function () { return console.warn("SwishjamJS not loaded yet, cannot call `getSession`.") }, window.Swishjam.newSession = function () { return console.warn("SwishjamJS not loaded yet, cannot call `newSession`.") }, window.Swishjam.identify = function (t, e) { return i.push({ name: "identify", properties: n({ userIdentifier: t }, e) }) }, window.Swishjam.event = function (t, e) { return i.push({ name: t, properties: e }) }, window.Swishjam.setOrganization = function (t, e) { return i.push({ name: "organization", properties: n({ organizationIdentifier: t }, e) }) }, window.Swishjam.onLoad = function (t) { return o.push(t) }; var a = document.createElement("script"); a.setAttribute("src", t), a.setAttribute("data-api-key", e), r.apiEndpoint && a.setAttribute("data-api-endpoint", r.apiEndpoint), r.maxEventsInMemory && a.setAttribute("data-max-events-in-memory", r.maxEventsInMemory), r.reportingHeartbeatMs && a.setAttribute("data-reporting-heartbeat-ms", r.reportingHeartbeatMs), document.head.appendChild(a), a.onload = function () { i.forEach((function (t) { switch (t.name) { case "identify": window.Swishjam.identify(t.properties.userIdentifier, t.properties); break; case "organization": window.Swishjam.setOrganization(t.properties.organizationIdentifier, t.properties); break; default: window.Swishjam.event(t.name, t.properties) } })), o.forEach((function (t) { return t(window.Swishjam) })) } }("https://unpkg.com/@swishjam/cdn@latest/build.js","swishjam-XXXXXXXX",{apiEndpoint:"https://swishjam-prod-9a00662c420f75d5.onporter.run/api/v1/capture"})})();
</script>
We recommend loading this on every page as we’ll automatically capture traffic for you.
Update the API key in the javascript snippet above
Replace swishjam-XXXXXXXX
with your API Key located in your Swishjam settings.
Swishjam supports multiple API keys:
- Segment & combine data easier
- Pre-built dashboards
Swishjam supports multiple API keys to help keep you data separated but easily connectable. We currently create 2 distinct API keys for you marketing and product keys. Below is more about each
Marketing API Key
The marketing api key is meant for your landing pages, docs, blog, and other similar sites. The marketing dashboard will auto-populate with data regarding page views, browser types, etc on users that land on these pages.
Product API Key
The product api key is meant for your app. Since you’ve sparated marketing from product we’re able to easily pre-build a product usage dashboard for your users.
Both keys feature the same features in terms of tracking events and identifying users. The core difference is in utilizing the pre-build dashboards out of the box.