Skip to content

Commit

Permalink
Fix the Ackee tracker import
Browse files Browse the repository at this point in the history
  • Loading branch information
suda committed Jan 11, 2023
1 parent 1d17938 commit b44437e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/ackee.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ackeeTracker from "ackee-tracker";
import { create, attributes } from "ackee-tracker";
import { writable } from "svelte/store";

const setupLocationStore = function (callback) {
Expand Down Expand Up @@ -36,7 +36,7 @@ const useAckeeSapper = function (
) {
let hasChanged = false;
let locationStore = setupLocationStore((changed) => (hasChanged = changed));
let currentInstance = ackeeTracker.create(server, opts);
let currentInstance = create(server, opts);
beforeUpdate(() => {
if (typeof window !== "undefined") {
locationStore.update((l) => {
Expand All @@ -52,11 +52,11 @@ const useAckeeSapper = function (
if (hasChanged) {
let path = window.location.pathname;

const attributes = ackeeTracker.attributes(opts.detailed);
const attrs = attributes(opts.detailed);
const url = new URL(path, location);

currentInstance.record(domainId, {
...attributes,
...attrs,
siteLocation: url.href,
}).stop;
}
Expand All @@ -83,7 +83,7 @@ const useAckeeSvelte = function (
) {
let hasChanged = false;
let locationStore = setupLocationStore((changed) => (hasChanged = changed));
let currentInstance = ackeeTracker.create(server, opts);
let currentInstance = create(server, opts);

afterPageLoad((page) => {
if (typeof window !== "undefined") {
Expand All @@ -97,11 +97,11 @@ const useAckeeSvelte = function (
if (hasChanged) {
let path = window.location.pathname;

const attributes = ackeeTracker.attributes(opts.detailed);
const attrs = attributes(opts.detailed);
const url = new URL(path, location);

currentInstance.record(domainId, {
...attributes,
...attrs,
siteLocation: url.href,
}).stop;
}
Expand Down

0 comments on commit b44437e

Please sign in to comment.