shimmer 0.0.25 → 0.0.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 98504a2ff4a7a068681ac784ca6efc00e3d1ec91aabb0f4a5599a12e87f8decf
4
- data.tar.gz: '08a7c167d5fa3611f925194591c1697b32c8fc1d572d54ea4f642567eadbf3e5'
3
+ metadata.gz: 56d4b2433dce6cff2fbaee9f1eb4591caf4f9abdbbc50aa9154f9eb81c5ce068
4
+ data.tar.gz: 9f95b3f5e0dfda4d102f529d7bd0334dbbbd4cbc31c026069be0a949f49f04c3
5
5
  SHA512:
6
- metadata.gz: a0adc008b3118a00a7ddcccb6d6541a50163cde552250871d33ed047a6299d7edcf9375f138eedb9240850bb47fd28e7913171f9df0dc89eabb5a11dab5de414
7
- data.tar.gz: 2c99878dfcaa144dcabb5a12920caf3626c3b15e86314c94aa38da5bc832bc4b194ed5c1e53396bcbbb679c23bbd6d590d339a260a104ac7cb2722fd72b55e2c
6
+ metadata.gz: 5625382dc2804fd1d0f6b93c8a2bdb391f2c2d632c70ab023ca22abdb7d661a746a799f13772f269ed160f420b32712825ec0ae5693683c98beb84f57c324f89
7
+ data.tar.gz: 559862f18bca1477be21b2cf40666da06c2b294177ecf4fac46a4d769ede304d55c767eab945c87b470d145bef7fbba3e0ebc1635f8174a633c7925279fadb94
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Shimmer
4
- VERSION = "0.0.25"
4
+ VERSION = "0.0.26"
5
5
  end
data/src/consent.ts CHANGED
@@ -54,7 +54,7 @@ export class Consent {
54
54
  ): Promise<void> {
55
55
  await this.consentFor(role);
56
56
  window.gtag("js", new Date());
57
- window.gtag("config", id);
57
+ window.gtag("config", id, { send_page_view: false }); // page view is disabled because it's tracked via the analytics stimulus controller already
58
58
  const script = document.createElement("script");
59
59
  script.async = true;
60
60
  script.setAttribute(
@@ -12,7 +12,8 @@ declare global {
12
12
  }
13
13
 
14
14
  const dataLayer = (window.dataLayer = window.dataLayer ?? []);
15
- function gtag(): void {
15
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
16
+ function gtag(..._arg): void {
16
17
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
17
18
  // @ts-ignore
18
19
  // eslint-disable-next-line prefer-rest-params
@@ -29,15 +30,15 @@ export default class extends Controller {
29
30
  const data = JSON.parse(
30
31
  (event.target as HTMLElement).dataset.analytics ?? "{}"
31
32
  );
32
- dataLayer.push(data);
33
+ const eventName = data["event"];
34
+ delete data["event"];
35
+ gtag("event", eventName, data);
33
36
  }
34
37
 
35
38
  recordPage(): void {
36
- const event = {
37
- event: "Pageview",
38
- path: location.pathname + location.search,
39
- host: location.host,
40
- };
41
- dataLayer.push(event);
39
+ gtag("event", "page_view", {
40
+ page_title: document.title,
41
+ page_location: document.location.toString(),
42
+ });
42
43
  }
43
44
  }
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.25
4
+ version: 0.0.26
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-10-07 00:00:00.000000000 Z
11
+ date: 2022-11-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake