shimmer 0.0.25 → 0.0.27

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: 98504a2ff4a7a068681ac784ca6efc00e3d1ec91aabb0f4a5599a12e87f8decf
4
- data.tar.gz: '08a7c167d5fa3611f925194591c1697b32c8fc1d572d54ea4f642567eadbf3e5'
3
+ metadata.gz: 9e35d3ffd274eed6d097eecc2063480939a12f02fce8ebed8fdb044eb3d1803d
4
+ data.tar.gz: 4e13f28ce0fd611a7c1c64304f3f74e16a3858bb74b5b0ff95c08ca1a4510e39
5
5
  SHA512:
6
- metadata.gz: a0adc008b3118a00a7ddcccb6d6541a50163cde552250871d33ed047a6299d7edcf9375f138eedb9240850bb47fd28e7913171f9df0dc89eabb5a11dab5de414
7
- data.tar.gz: 2c99878dfcaa144dcabb5a12920caf3626c3b15e86314c94aa38da5bc832bc4b194ed5c1e53396bcbbb679c23bbd6d590d339a260a104ac7cb2722fd72b55e2c
6
+ metadata.gz: b729abf735db7fe90b129af95bbe00447bce77031a6e3c92fe4d467559ec23d4a6aae69076d40cad1c176902046f83b4905898ff87d7ce5d86d183b315b4a652
7
+ data.tar.gz: c3cc9de1117a71a9711522cc73c072edfc018508cf2d040c52d84f25cb5295927b1e4c3e01455849ef2ad76d9fc051ca38250c54d8882e724e9d8b5a3fcc63e5
@@ -13,7 +13,7 @@ module Shimmer
13
13
  end
14
14
  end
15
15
 
16
- def input(method, as: guess_type(method), wrapper_options: {}, description: nil, label_method: nil, **options)
16
+ def input(method, as: guess_type(method), wrapper_options: {}, description: nil, label_method: nil, id_method: :id, name_method: nil, label: nil, **options)
17
17
  as ||= guess_type(method)
18
18
  options[:class] ||= "input__input"
19
19
  collection = options.delete :collection
@@ -32,7 +32,7 @@ module Shimmer
32
32
  input.prepare
33
33
  wrapper_options.reverse_merge! input.wrapper_options
34
34
  label_method ||= wrapper_options.delete(:label_method)
35
- wrap method: method, content: input.render, classes: classes + ["input--#{as}"], label: options[:label], extra: extra, description: description, options: wrapper_options, label_method: label_method
35
+ wrap method: method, content: input.render, classes: classes + ["input--#{as}"], label: label, extra: extra, description: description, options: wrapper_options, label_method: label_method
36
36
  end
37
37
 
38
38
  private
@@ -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.27"
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.27
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