Skip to content

Commit 0679b74

Browse files
committed
TrackingConsent: add api reference link for options / now supporting null and string[] as options value’s type
1 parent ad9ea69 commit 0679b74

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/components/TrackingConsent.vue

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class TrackingConsent extends Vue {
7575
})
7676
public theme: string;
7777
78+
/** API reference: https://developer.matomo.org/guides/tracking-javascript#configuration-of-the-tracker-object */
7879
@Prop({
7980
type: Object,
8081
default: () => ({
@@ -85,10 +86,7 @@ class TrackingConsent extends Vue {
8586
public options: {
8687
setSiteId: number,
8788
setTrackerUrl?: string
88-
addDownloadExtensions?: string,
89-
trackPageView?: boolean,
90-
enableLinkTracking?: boolean,
91-
[k: string]: number | string | boolean,
89+
[k: string]: null | boolean | number | string | string[],
9290
};
9391
9492
@Prop({
@@ -370,9 +368,7 @@ class TrackingConsent extends Vue {
370368
Object.keys(this.options).forEach((k) => {
371369
const option = this.options[k];
372370
373-
if (option) {
374-
TrackingConsent._paq.push(typeof option === 'boolean' ? [k] : [k, option]);
375-
}
371+
TrackingConsent._paq.push(option === null ? [k] : [k, option]);
376372
});
377373
378374
/* append script */

0 commit comments

Comments
 (0)