MatteoGabriele/vue-gtag-next

View on GitHub
src/api/disable.js

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { isBrowser } from "@/utils";
import { allProperties } from "@/state";

export default (value = true) => {
  if (!isBrowser()) {
    return;
  }

  allProperties.value.forEach((property) => {
    window[`ga-disable-${property.id}`] = value;
  });
};