shimmer 0.0.21 → 0.0.22

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 89571a33faa2d1fd1d8c9624ab42a51f019418efc9c91af68fb3bb0385b5f602
4
- data.tar.gz: 814bca1dbd13b0e147df173b1b41077c0c585f4bd5b8e1b9e6933051d597f231
3
+ metadata.gz: 36f3761e1bd5856a9fd2078201abda25b544eff5e807566ce85847ba291c47d9
4
+ data.tar.gz: c946f2ec830a472aee08d835dbb697711d46c107152723ee8f9bb43a36bc4173
5
5
  SHA512:
6
- metadata.gz: 6d1c9bfa6f442914ca03747cf391ebf52086cb2c92d334641715031539cef826f09e171d3510e20866780ed87a1829182872485f6cd143c833ddebab97e1abf8
7
- data.tar.gz: 5db21bb6096a9a4a555b17c05d2ba128379f049ed87bae1e9fd9cddf824a05214c9858d8760924ea948d11645f9052b3d503167a098ece2ba97fb5ca498db754
6
+ metadata.gz: d8bb839595c9e32ab185276bdaac0c8a6f43b4ce1fb1ce0d82d47a1c18c5ae082e29caa68c34d14856db2ebb2001fe4774f5b687599b794706d199767bd46de1
7
+ data.tar.gz: 885c2bdb0326b02c3eebd7d4606d79906b52264ef8b6043dc6f4061dffd6c8b5a786af22f9d25378d7aa21988a34d6412409adcd7acb6acce7f478e342323eba
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shimmer
4
- VERSION = "0.0.21"
4
+ VERSION = "0.0.22"
5
5
  end
data/src/consent.ts CHANGED
@@ -53,12 +53,14 @@ export class Consent {
53
53
  role: ConsentCategory = "statistic"
54
54
  ): Promise<void> {
55
55
  await this.consentFor(role);
56
+ window.gtag("js", new Date());
56
57
  window.gtag("config", id);
57
58
  const script = document.createElement("script");
59
+ script.async = true;
58
60
  script.setAttribute(
59
61
  "src",
60
62
  `https://www.googletagmanager.com/gtag/js?id=${id}`
61
63
  );
62
- document.head.appendChild(script);
64
+ document.head.prepend(script);
63
65
  }
64
66
  }
@@ -12,12 +12,13 @@ declare global {
12
12
  }
13
13
 
14
14
  const dataLayer = (window.dataLayer = window.dataLayer ?? []);
15
-
16
- window.gtag = (...arg) => {
17
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
- dataLayer.push(arg as any);
19
- };
20
- window.gtag("js", new Date());
15
+ function gtag(): void {
16
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
17
+ // @ts-ignore
18
+ // eslint-disable-next-line prefer-rest-params
19
+ dataLayer.push(arguments);
20
+ }
21
+ window.gtag = gtag;
21
22
 
22
23
  export default class extends Controller {
23
24
  connect(): void {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shimmer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.21
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Ravens
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-08 00:00:00.000000000 Z
11
+ date: 2022-08-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake