@walkeros/web-destination-gtag 2.0.0 → 2.1.0

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$meta": {
3
3
  "package": "@walkeros/web-destination-gtag",
4
- "version": "2.0.0",
4
+ "version": "2.0.1",
5
5
  "type": "destination",
6
6
  "platform": "web"
7
7
  },
@@ -342,267 +342,340 @@
342
342
  "call:window.gtag"
343
343
  ]
344
344
  },
345
- "events": {
346
- "adsConversion": {
347
- "$code": "function th(){const e=Qg(\"order complete\");return[\"event\",\"conversion\",{send_to:\"AW-XXXXXXXXX/CONVERSION_LABEL\",currency:\"EUR\",value:e.data.total,transaction_id:e.data.id}]}"
348
- },
349
- "ga4AddToCart": {
350
- "$code": "function nh(){const e=Qg(\"product add\");return[\"event\",\"add_to_cart\",{currency:\"EUR\",value:e.data.price,items:[{item_id:e.data.id,item_variant:e.data.color,quantity:1}],send_to:\"G-XXXXXX-1\"}]}"
351
- },
352
- "ga4Purchase": {
353
- "$code": "function eh(){const e=Qg(\"order complete\");return[\"event\",\"purchase\",{transaction_id:e.data.id,value:e.data.total,tax:e.data.taxes,shipping:e.data.shipping,currency:\"EUR\",items:e.nested.filter(e=>\"product\"===e.entity).map(e=>({item_id:e.data.id,item_name:e.data.name,quantity:1})),send_to:\"G-XXXXXX-1\"}]}"
354
- },
355
- "gtmEvent": {
356
- "$code": "function ih(){const e=Qg(\"product view\");return{event:\"product_view\",product_id:e.data.id,product_name:e.data.name,product_category:e.data.category,value:e.data.price,currency:\"EUR\"}}"
357
- }
358
- },
359
- "mapping": {
360
- "adsConversion": {
361
- "name": "CONVERSION_LABEL",
362
- "settings": {
363
- "ads": {}
364
- },
365
- "data": {
366
- "map": {
367
- "value": "data.total",
368
- "currency": {
369
- "value": "EUR",
370
- "key": "data.currency"
371
- },
372
- "transaction_id": "data.id"
373
- }
374
- }
375
- },
376
- "combinedPurchase": {
377
- "name": "purchase",
378
- "settings": {
379
- "ga4": {
380
- "include": [
381
- "data"
345
+ "step": {
346
+ "addToCart": {
347
+ "in": {
348
+ "name": "product add",
349
+ "data": {
350
+ "id": "ers",
351
+ "name": "Everyday Ruck Snack",
352
+ "color": "black",
353
+ "size": "l",
354
+ "price": 420
355
+ },
356
+ "context": {
357
+ "shopping": [
358
+ "intent",
359
+ 0
382
360
  ]
383
361
  },
384
- "ads": {},
385
- "gtm": {}
362
+ "globals": {
363
+ "pagegroup": "shop"
364
+ },
365
+ "custom": {
366
+ "completely": "random"
367
+ },
368
+ "user": {
369
+ "id": "us3r",
370
+ "device": "c00k13",
371
+ "session": "s3ss10n"
372
+ },
373
+ "nested": [],
374
+ "consent": {
375
+ "functional": true
376
+ },
377
+ "id": "1700000101-gr0up-1",
378
+ "trigger": "click",
379
+ "entity": "product",
380
+ "action": "add",
381
+ "timestamp": 1700000101,
382
+ "timing": 3.14,
383
+ "group": "gr0up",
384
+ "count": 1,
385
+ "version": {
386
+ "source": "2.0.1",
387
+ "tagging": 1
388
+ },
389
+ "source": {
390
+ "type": "web",
391
+ "id": "https://localhost:80",
392
+ "previous_id": "http://remotehost:9001"
393
+ }
386
394
  },
387
- "data": {
388
- "map": {
389
- "transaction_id": "data.id",
390
- "value": "data.total",
391
- "currency": {
392
- "value": "EUR",
393
- "key": "data.currency"
394
- },
395
- "items": {
396
- "loop": [
397
- "nested",
398
- {
399
- "condition": {
400
- "$code": "e=>Hg(e)&&\"product\"===e.entity"
401
- },
402
- "map": {
403
- "item_id": "data.id",
404
- "item_name": "data.name",
405
- "quantity": {
406
- "value": 1,
407
- "key": "data.quantity"
408
- }
409
- }
410
- }
395
+ "mapping": {
396
+ "name": "add_to_cart",
397
+ "settings": {
398
+ "ga4": {
399
+ "include": [
400
+ "data"
411
401
  ]
412
402
  }
413
- }
414
- }
415
- },
416
- "config": {
417
- "order": {
418
- "complete": {
419
- "name": "purchase",
420
- "settings": {
421
- "ga4": {
422
- "include": [
423
- "data"
424
- ]
403
+ },
404
+ "data": {
405
+ "map": {
406
+ "currency": {
407
+ "value": "EUR",
408
+ "key": "data.currency"
425
409
  },
426
- "ads": {},
427
- "gtm": {}
428
- },
429
- "data": {
430
- "map": {
431
- "transaction_id": "data.id",
432
- "value": "data.total",
433
- "currency": {
434
- "value": "EUR",
435
- "key": "data.currency"
436
- },
437
- "items": {
438
- "loop": [
439
- "nested",
440
- {
441
- "condition": {
442
- "$code": "e=>Hg(e)&&\"product\"===e.entity"
443
- },
444
- "map": {
445
- "item_id": "data.id",
446
- "item_name": "data.name",
447
- "quantity": {
448
- "value": 1,
449
- "key": "data.quantity"
450
- }
410
+ "value": "data.price",
411
+ "items": {
412
+ "loop": [
413
+ "this",
414
+ {
415
+ "map": {
416
+ "item_id": "data.id",
417
+ "item_variant": "data.color",
418
+ "quantity": {
419
+ "value": 1,
420
+ "key": "data.quantity"
451
421
  }
452
422
  }
453
- ]
454
- }
423
+ }
424
+ ]
455
425
  }
456
426
  }
457
427
  }
458
428
  },
459
- "product": {
460
- "add": {
461
- "name": "add_to_cart",
462
- "settings": {
463
- "ga4": {
464
- "include": [
465
- "data"
466
- ]
429
+ "out": [
430
+ "event",
431
+ "add_to_cart",
432
+ {
433
+ "currency": "EUR",
434
+ "value": 420,
435
+ "items": [
436
+ {
437
+ "item_id": "ers",
438
+ "item_variant": "black",
439
+ "quantity": 1
467
440
  }
468
- },
469
- "data": {
470
- "map": {
471
- "currency": {
472
- "value": "EUR",
473
- "key": "data.currency"
474
- },
475
- "value": "data.price",
476
- "items": {
477
- "loop": [
478
- "this",
479
- {
480
- "map": {
481
- "item_id": "data.id",
482
- "item_variant": "data.color",
483
- "quantity": {
484
- "value": 1,
485
- "key": "data.quantity"
486
- }
487
- }
488
- }
489
- ]
490
- }
491
- }
492
- }
493
- },
494
- "view": {
495
- "name": "product_view",
496
- "settings": {
497
- "gtm": {}
498
- },
499
- "data": {
500
- "map": {
501
- "product_id": "data.id",
502
- "product_name": "data.name",
503
- "product_category": "data.category",
504
- "value": "data.price",
505
- "currency": {
506
- "value": "EUR",
507
- "key": "data.currency"
508
- }
509
- }
510
- }
441
+ ],
442
+ "send_to": "G-XXXXXX-1"
511
443
  }
512
- }
444
+ ]
513
445
  },
514
- "ga4AddToCart": {
515
- "name": "add_to_cart",
516
- "settings": {
517
- "ga4": {
518
- "include": [
519
- "data"
446
+ "pageView": {
447
+ "in": {
448
+ "name": "page view",
449
+ "data": {
450
+ "domain": "www.example.com",
451
+ "title": "walkerOS documentation",
452
+ "referrer": "https://www.walkeros.io/",
453
+ "search": "?foo=bar",
454
+ "hash": "#hash",
455
+ "id": "/docs/"
456
+ },
457
+ "context": {
458
+ "dev": [
459
+ "test",
460
+ 1
520
461
  ]
462
+ },
463
+ "globals": {
464
+ "pagegroup": "docs"
465
+ },
466
+ "custom": {
467
+ "completely": "random"
468
+ },
469
+ "user": {
470
+ "id": "us3r",
471
+ "device": "c00k13",
472
+ "session": "s3ss10n"
473
+ },
474
+ "nested": [
475
+ {
476
+ "entity": "child",
477
+ "data": {
478
+ "is": "subordinated"
479
+ },
480
+ "nested": [],
481
+ "context": {
482
+ "element": [
483
+ "child",
484
+ 0
485
+ ]
486
+ }
487
+ }
488
+ ],
489
+ "consent": {
490
+ "functional": true
491
+ },
492
+ "id": "1700000102-gr0up-1",
493
+ "trigger": "load",
494
+ "entity": "page",
495
+ "action": "view",
496
+ "timestamp": 1700000102,
497
+ "timing": 3.14,
498
+ "group": "gr0up",
499
+ "count": 1,
500
+ "version": {
501
+ "source": "2.0.1",
502
+ "tagging": 1
503
+ },
504
+ "source": {
505
+ "type": "web",
506
+ "id": "https://localhost:80",
507
+ "previous_id": "http://remotehost:9001"
521
508
  }
522
509
  },
523
- "data": {
524
- "map": {
525
- "currency": {
526
- "value": "EUR",
527
- "key": "data.currency"
528
- },
529
- "value": "data.price",
530
- "items": {
531
- "loop": [
532
- "this",
533
- {
534
- "map": {
535
- "item_id": "data.id",
536
- "item_variant": "data.color",
537
- "quantity": {
538
- "value": 1,
539
- "key": "data.quantity"
540
- }
541
- }
542
- }
543
- ]
544
- }
510
+ "out": [
511
+ "event",
512
+ "page_view",
513
+ {
514
+ "send_to": "G-XXXXXX-1"
545
515
  }
546
- }
516
+ ]
547
517
  },
548
- "ga4Purchase": {
549
- "name": "purchase",
550
- "settings": {
551
- "ga4": {
552
- "include": [
553
- "data",
554
- "context"
518
+ "purchase": {
519
+ "in": {
520
+ "name": "order complete",
521
+ "data": {
522
+ "id": "0rd3r1d",
523
+ "currency": "EUR",
524
+ "shipping": 5.22,
525
+ "taxes": 73.76,
526
+ "total": 555
527
+ },
528
+ "context": {
529
+ "shopping": [
530
+ "complete",
531
+ 0
555
532
  ]
533
+ },
534
+ "globals": {
535
+ "pagegroup": "shop"
536
+ },
537
+ "custom": {
538
+ "completely": "random"
539
+ },
540
+ "user": {
541
+ "id": "us3r",
542
+ "device": "c00k13",
543
+ "session": "s3ss10n"
544
+ },
545
+ "nested": [
546
+ {
547
+ "entity": "product",
548
+ "data": {
549
+ "id": "ers",
550
+ "name": "Everyday Ruck Snack",
551
+ "color": "black",
552
+ "size": "l",
553
+ "price": 420
554
+ },
555
+ "context": {
556
+ "shopping": [
557
+ "complete",
558
+ 0
559
+ ]
560
+ },
561
+ "nested": []
562
+ },
563
+ {
564
+ "entity": "product",
565
+ "data": {
566
+ "id": "cc",
567
+ "name": "Cool Cap",
568
+ "size": "one size",
569
+ "price": 42
570
+ },
571
+ "context": {
572
+ "shopping": [
573
+ "complete",
574
+ 0
575
+ ]
576
+ },
577
+ "nested": []
578
+ },
579
+ {
580
+ "entity": "gift",
581
+ "data": {
582
+ "name": "Surprise"
583
+ },
584
+ "context": {
585
+ "shopping": [
586
+ "complete",
587
+ 0
588
+ ]
589
+ },
590
+ "nested": []
591
+ }
592
+ ],
593
+ "consent": {
594
+ "functional": true
595
+ },
596
+ "id": "1700000100-gr0up-1",
597
+ "trigger": "load",
598
+ "entity": "order",
599
+ "action": "complete",
600
+ "timestamp": 1700000100,
601
+ "timing": 3.14,
602
+ "group": "gr0up",
603
+ "count": 1,
604
+ "version": {
605
+ "source": "2.0.1",
606
+ "tagging": 1
607
+ },
608
+ "source": {
609
+ "type": "web",
610
+ "id": "https://localhost:80",
611
+ "previous_id": "http://remotehost:9001"
556
612
  }
557
613
  },
558
- "data": {
559
- "map": {
560
- "transaction_id": "data.id",
561
- "value": "data.total",
562
- "tax": "data.taxes",
563
- "shipping": "data.shipping",
564
- "currency": {
565
- "key": "data.currency",
566
- "value": "EUR"
567
- },
568
- "items": {
569
- "loop": [
570
- "nested",
571
- {
572
- "condition": {
573
- "$code": "e=>Hg(e)&&\"product\"===e.entity"
574
- },
575
- "map": {
576
- "item_id": "data.id",
577
- "item_name": "data.name",
578
- "quantity": {
579
- "key": "data.quantity",
580
- "value": 1
614
+ "mapping": {
615
+ "name": "purchase",
616
+ "settings": {
617
+ "ga4": {
618
+ "include": [
619
+ "data",
620
+ "context"
621
+ ]
622
+ }
623
+ },
624
+ "data": {
625
+ "map": {
626
+ "transaction_id": "data.id",
627
+ "value": "data.total",
628
+ "tax": "data.taxes",
629
+ "shipping": "data.shipping",
630
+ "currency": {
631
+ "key": "data.currency",
632
+ "value": "EUR"
633
+ },
634
+ "items": {
635
+ "loop": [
636
+ "nested",
637
+ {
638
+ "condition": {
639
+ "$code": "e=>fh(e)&&\"product\"===e.entity"
640
+ },
641
+ "map": {
642
+ "item_id": "data.id",
643
+ "item_name": "data.name",
644
+ "quantity": {
645
+ "key": "data.quantity",
646
+ "value": 1
647
+ }
581
648
  }
582
649
  }
583
- }
584
- ]
650
+ ]
651
+ }
585
652
  }
586
653
  }
587
- }
588
- },
589
- "gtmProductView": {
590
- "name": "product_view",
591
- "settings": {
592
- "gtm": {}
593
654
  },
594
- "data": {
595
- "map": {
596
- "product_id": "data.id",
597
- "product_name": "data.name",
598
- "product_category": "data.category",
599
- "value": "data.price",
600
- "currency": {
601
- "value": "EUR",
602
- "key": "data.currency"
603
- }
655
+ "out": [
656
+ "event",
657
+ "purchase",
658
+ {
659
+ "transaction_id": "0rd3r1d",
660
+ "value": 555,
661
+ "tax": 73.76,
662
+ "shipping": 5.22,
663
+ "currency": "EUR",
664
+ "items": [
665
+ {
666
+ "item_id": "ers",
667
+ "item_name": "Everyday Ruck Snack",
668
+ "quantity": 1
669
+ },
670
+ {
671
+ "item_id": "cc",
672
+ "item_name": "Cool Cap",
673
+ "quantity": 1
674
+ }
675
+ ],
676
+ "send_to": "G-XXXXXX-1"
604
677
  }
605
- }
678
+ ]
606
679
  }
607
680
  }
608
681
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@walkeros/web-destination-gtag",
3
3
  "description": "Unified Google destination for walkerOS (GA4, Ads, GTM)",
4
- "version": "2.0.0",
4
+ "version": "2.1.0",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.mjs",
@@ -36,7 +36,7 @@
36
36
  "update": "npx npm-check-updates -u && npm update"
37
37
  },
38
38
  "dependencies": {
39
- "@walkeros/web-core": "^2.0.0"
39
+ "@walkeros/web-core": "^2.1.0"
40
40
  },
41
41
  "repository": {
42
42
  "url": "git+https://github.com/elbwalker/walkerOS.git",