Compare commits

..

282 Commits

Author SHA1 Message Date
4ae48d1148 make installable in OX7.2 2025-04-29 10:03:26 +02:00
fcdb794c93 [Bump] Changelog 2025-03-19 17:09:00 +01:00
5d547247bc [Fixed] changelog 2025-03-19 17:06:12 +01:00
0b2209136f [Bump] Changelog && Metadata 2025-03-19 16:52:06 +01:00
6172cbcbd8 [Fixed] over-engineered Getter-methods
- the methods would semi-automatic search and set/ save params
- I removed those and set it back to its base functionality:
-- saving happens ONLY at the save() function if triggered by the user in the admin-frontend
-- only one Getter who checks for a value in the DB ? give the value : no value given yet
2025-03-19 16:48:28 +01:00
bbcb9d7063 [Fixed] bash-hints readme; [Added] changelog entries 2024-11-25 19:00:56 +01:00
8097c8019b [Changed] version constraint 2024-11-25 18:49:23 +01:00
85f99f25ad [Fixed] view_cart template register 2024-11-25 18:49:07 +01:00
c27834536d [Changed] code cleanup
php cs fixer
2024-11-25 18:48:39 +01:00
2cd0652c31 don't submit item prices, if user doesn't have "show price" right
# Conflicts:
#	Application/views/ga4/remove_from_cart.tpl
#	Application/views/ga4/view_search_result.tpl
2024-11-15 13:46:04 +01:00
df179568c9 use Constants ergänzt 2024-11-04 15:20:44 +01:00
a702a211ef [Added] module-activated check
since its a private method in OXID7
2024-10-05 19:01:00 +02:00
9fde587cfd [Fixed] template paths 2024-10-05 18:59:21 +02:00
6111cf50ad Merge branch 'dev_3.x_OXID7' of https://git.d3data.de/D3Public/GoogleAnalytics4 into dev_3.x_OXID7 2024-10-05 18:15:57 +02:00
474737bcdc [Changed] composer reqs 2024-10-05 18:14:57 +02:00
c539c898d9 [Changed] OXID 7 file adjustments 2024-09-21 18:16:52 +02:00
8bbf7e4fa7 [Changed] OXID7 metadata adjustments 2024-09-21 18:15:57 +02:00
2ec373c95f [Bump] Metadata && Changelog 2024-09-21 16:23:06 +02:00
6fcb9f8b84 [Changed] add "internal_names" to constant 2024-09-21 16:20:48 +02:00
53b3c878ce [Fixed] Consentmanager doesn't get delivered
false value given for important decision-making. Since the value was false, we got "false" as return for D3blShowGtmScript() which made consentmanager not send the data to GTM
2024-09-21 16:08:08 +02:00
65b618e25c [Removed] unnecessary "none" entry for CMP-choosability 2024-09-21 16:06:32 +02:00
4b2c978035 [Bump] Metadata && Changelog 2024-09-19 16:20:19 +02:00
2a27b25c5a Merge remote-tracking branch 'remotes/origin/dev_2.x_d3GtmStartController' into rel_2.x 2024-09-19 15:33:02 +02:00
a8ca33b10d Bump metadata && changelog 2024-09-11 17:26:58 +02:00
31bafa621b [Fixed] currency in begin_checkout 2024-09-11 17:23:04 +02:00
48e2dc58ad Methode umbenannt 2024-08-27 14:25:55 +02:00
f27040e7dd [Bump] Metadata 2024-08-20 20:14:56 +02:00
79994eae69 [Added] new Event "add_payment_info"
- add Payment-Model extension for own small method
- new block extension
- new template for the event-data for GA
- metadata adjustments for it
2024-08-20 19:58:02 +02:00
6bdf788ebf [Added] new Event "begin_checkout"
- new block extension
- new template for the event-data for GA
- metadata adjustments for it
- new version ( 2.20.0 )
2024-08-20 18:59:14 +02:00
98ddc51a4d [Changed] clean code 2024-08-18 16:40:49 +02:00
9edf3b9265 [Bump] Metadata && Changelog 2024-08-10 13:50:49 +02:00
48a598da51 render() ergänzen 2024-08-08 15:03:48 +02:00
bc1dafbbfa Erweiterung verschieben 2024-08-08 14:16:25 +02:00
2a1f8f5794 Erweiterung verschieben 2024-08-08 10:36:55 +02:00
7bc73893c3 Prevent "OXID Logger.ERROR: D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmStartController is not an instance of OxidEsales\Eshop\Application\Component\Widget\WidgetController" 2024-08-08 10:21:22 +02:00
2f7b07ab95 Merge remote-tracking branch 'origin/dev_2.x_12787_bug_fixing' into dev_2.x_12787_bug_fixing 2024-07-30 16:04:34 +02:00
84240f96a9 [Fixed] typo 2024-07-30 16:04:27 +02:00
542471b053 [Fixed] typo 2024-07-30 15:56:02 +02:00
7873714f17 [Fixed] missing class extension
Activating the Module on CLI happens so early, there's no ModuleChain available yet, therefor no extension, therefor no additional methods
2024-07-30 15:55:52 +02:00
6dff6860bf [Change] classify composer requirements more strictly
classify PHP and OXID-CE-Version
2024-07-30 15:05:37 +02:00
81c7051f7b [Bump] Metadata && Changelog 2024-06-25 11:22:18 +02:00
29831fa157 Merge remote-tracking branch 'remotes/origin/dev_2.x_fix_onactivate' into rel_2.x 2024-06-25 11:16:49 +02:00
cf143c4881 Merge remote-tracking branch 'origin/dev_2.x_fix_onactivate' into dev_2.x_fix_onactivate
# Conflicts:
#	Setup/Actions.php
2024-06-24 16:24:30 +02:00
16387c59bb [Fixed] overwriting existing settings
accidentally the existing settings were overwritten
2024-06-24 16:24:11 +02:00
cc2e9a5fc6 [Fixed] overwriting existing settings
accidentally the existing settings were overwritten
2024-06-24 16:08:36 +02:00
97dad5c8eb [Bump] Metadata && Changelog 2024-06-04 12:10:47 +02:00
b7167ec60a [Fixed] missing return statements, on null 2024-06-04 12:09:29 +02:00
592ea4284c [Bump] Changelog 2024-06-03 12:15:32 +02:00
1dc65ad24a [Fixed] wrong to-save param 2024-06-03 12:15:00 +02:00
efac71905e [Bump] Changelog 2024-06-03 12:03:03 +02:00
10386ccbf5 [Added] onActivate/ onDeactivate 2024-06-03 12:02:44 +02:00
62ef191d47 [Added] extended changelog entries 2024-06-03 11:51:08 +02:00
cea8cc9163 [Removed] false xml excludation 2024-06-03 11:49:59 +02:00
4b69a583c2 [Bump] Metadata && Changelog 2024-06-03 11:42:39 +02:00
9a5e1506e8 [Changed] clear code and adjust Naming 2024-05-31 15:47:54 +02:00
e500814e7e [Added] auto safe on first approach ga4 + cmp-mod 2024-05-31 15:46:10 +02:00
0dc5565640 [Changed] way of manager-classification in tpl 2024-05-31 15:42:58 +02:00
1dd353ce58 [Changed] Usercentrics-Class constants and adjust glob-code to it 2024-05-31 15:18:26 +02:00
bbd7b5ec95 [Added] extended translations/ explanations 2024-05-31 11:58:00 +02:00
1356f2f0e7 [Added] Container-ID explanation to docs 2024-05-31 11:57:46 +02:00
fca1231032 [Added] Help text
multilang + template entries
2024-05-29 16:48:28 +02:00
c4652df373 [Changed] amount of save-buttons 2024-05-29 16:23:38 +02:00
c7ee79f271 [Changed] lang text 2024-05-29 16:23:25 +02:00
8c5e110265 [Bump] metadata for testing 2024-05-29 15:55:40 +02:00
ed7a93b8ae [Changed] clear code 2024-05-29 15:54:57 +02:00
e7d921f20e [Added] new CMP individualisation to own Model
this is the first step into manifesting "big" CMP's into own Models that require strong individualism partially
2024-05-29 15:54:55 +02:00
049454a782 [OST497528][Added] usercentrips step/ option 2
detailed information about the new addings check docs: https://docs.usercentrics.com/#/consent-mode
2024-05-29 15:51:16 +02:00
8e52b0541a [Added] admin headitem alternative 2024-05-29 15:48:29 +02:00
cb9cd11ff5 [Changed] template code upgrade
change generic-html-tag id and controll names to specified names
2024-05-29 13:54:00 +02:00
ef29f7eb1b [Added] additional check for properly activated module 2024-05-29 12:16:22 +02:00
4a4b328364 [Fixed] false class-property declaration 2024-05-29 12:15:55 +02:00
09ccb6726d [Changed] clear dead code 2024-05-29 12:05:32 +02:00
54d6918fcf [Removed] deprecated and obsolete module-settings 2024-05-29 12:00:07 +02:00
7ab62493e4 [Changed] configParamGetter 2024-05-29 11:59:38 +02:00
91e0c5c0c9 [Added] new Admin-UI 2024-05-29 11:40:36 +02:00
96f6321b14 [Changed] declare module settings consistency 2024-05-23 10:30:11 +02:00
a184627443 [Added] unreleased branch comparison to chnagelog 2024-04-12 10:07:38 +02:00
681d0932e0 [Added] trait for generalized method 2024-04-12 10:04:04 +02:00
efc9aa08e0 [Bump] changelog 2024-04-11 12:01:12 +02:00
db39d4155f [Bump] changelog 2024-04-11 11:58:55 +02:00
17839b319e [Bump] metadata && changelog 2024-04-11 11:42:24 +02:00
7847ad9874 [Fixed] potential error
if no basket-component is given, error occurs
2024-04-11 11:40:41 +02:00
b3f2446a7d [Bump] Metadata && Changelog 2024-04-10 12:23:04 +02:00
ce1614996a [Fixed] getGtmContainerId gave false/ null
on second call method gave false
2024-04-10 12:21:21 +02:00
ec2d43ff3c [Bump] Metadata && Changelog 2024-04-10 12:01:37 +02:00
c32c66322f [Changed] styling 2024-04-10 11:58:14 +02:00
8079eee236 [OST830498][Removed] ( for now ) unnecessary set 2024-04-10 11:45:48 +02:00
00c0bd2497 [OST830498][Fixed] comment-error
Syntax-Error duo to the OXID-strip that made the inline-comment cut off "})" of the code
2024-04-10 11:44:35 +02:00
76eeb0d5bd [OST830498][Fixed] dataLayer overwriting 2024-04-08 15:19:26 +02:00
0baa44e5d7 [OST830498][Added] multilang ident 2024-04-04 14:41:47 +02:00
a38dcb8e45 [OST830498][Added] consent-mode standard values 2024-04-02 08:59:17 +02:00
1ae5a9d926 [OST830498][Changed] metadataid centralized 2024-03-25 09:06:22 +01:00
938d1514a6 [Bump] Changelog && Metadata 2024-03-20 10:14:06 +01:00
9a48d32c3b [OST#929760][Added] multilang texts for desc
Test: OK
2024-03-20 10:11:42 +01:00
bc8876367c [OST#929760][Added] serverside tagging usability
*missing any test, yet!
2024-03-19 09:22:07 +01:00
9410495a58 [Bump] Metadata && Changelog 2024-02-05 14:12:02 +01:00
05df5ef100 [Fix] missing Component-ArticleDetails extension; missing ManufacturerList-Extension 2024-02-05 11:18:15 +01:00
59ef1d0625 [Added] extended Doks 2024-01-22 14:30:59 +01:00
e4969f2cbd [Changed] phpstan.neon 2024-01-22 14:23:09 +01:00
13ef2bef7b [Changed] phpstan.neon 2024-01-22 11:27:04 +01:00
59f0e37cce bump changelog && version to 2.14.0 2024-01-22 11:16:16 +01:00
bcf38a6e11 Merge remote-tracking branch 'remotes/origin/rel_1.x' into dev_2.x 2024-01-22 11:13:05 +01:00
31b3474cfd [Bump] metadata && changelog 2024-01-22 09:09:26 +01:00
1a641de8fc [Added] PHPStan lvl 5, error-ignoring; [Fixed] user-Getter evaluation 2024-01-19 11:54:48 +01:00
268cf6f6da [Working] set PHPStan to lvl 5 2024-01-17 16:07:41 +01:00
5d5b3459cd [Changed] phpStan - set level to 4, clear files by level
Also changed method, to get the category for items (products)
2024-01-17 15:53:51 +01:00
1c1080923b [Changed] phpStan - set level to 3, clean files by level 2024-01-17 15:36:43 +01:00
007e83909b [Added] search controller extension (add_to_cart) 2024-01-17 15:32:59 +01:00
ed5fcc6011 bump changelog && version to 2.13.1 2024-01-03 13:48:43 +01:00
22ea5a1ce2 [Fixed] error on array-count at zero entries 2024-01-03 13:46:43 +01:00
229cf3695f [Changed] template structure, template-structure information
all block extensions now only include the template instead of having the extension included immediately (dedicated event-templates within views/event); information about the structure changed to the correct paths
2024-01-02 16:07:53 +01:00
a990834da4 [Added] missing IntelliSenseHelper entry for Manufacturer 2024-01-02 13:19:20 +01:00
6047f72edf [Added] phpstan + phpstan file 2024-01-02 11:54:07 +01:00
e2564f613a [Changed] capture implementation
reworked to a safer path-through to get the data
2023-12-18 11:59:12 +01:00
9ea5408e44 [Added] add_to_cart to start-template 2023-12-18 11:23:43 +01:00
ab6b7f7454 [Added] add_to_cart to recommlist, wishlist, noticelist, Class-Extensions for corresponding templates 2023-11-07 15:23:40 +01:00
a88fa570a8 [Added] add_to_cart to page/list/list.tpl, BasketComponent methods for trigger-behaviour add_to_cart 2023-11-07 11:00:28 +01:00
81aab10c4e [Changed] process-list of add_to_cart; [Added] BasketComponent extensions to controll the trigger-behaviour of add_to_cart, ArticleDetailsController extension for add_to_Cart i view_item
add_to_cart no longer is a block extension, changed to an indiv tpl-file
2023-11-07 10:59:39 +01:00
5ac3385b53 [Added] add_to_cart to page/list/list.tpl 2023-11-02 13:36:44 +01:00
5c98d99d80 bump metadata && changelog 2023-09-13 16:02:49 +02:00
19553fcee2 bump metadata and readme 2023-09-13 16:00:12 +02:00
da2966626e cleaning; adjust not set param handling 2023-09-13 15:15:49 +02:00
6fcee0671f adjust set-param check 2023-09-13 15:15:22 +02:00
bb513e6ded adjust set-param check 2023-09-13 15:13:35 +02:00
f64eb35763 switch control-param name 2023-09-13 15:09:27 +02:00
36b3aa9ef2 switch param-name 2023-09-13 15:08:58 +02:00
b2d8d597fd switch name of control-parameter; switch consentmanager-script-adjustments
# Conflicts:
#	Modules/Core/ViewConfig.php
2023-09-13 15:02:50 +02:00
36ac641233 adjust Doku with further infos new cookieid -> Control parameter 2023-09-13 15:00:44 +02:00
ef4e4625cd switch name of control-parameter; switch consentmanager-script-adjustments 2023-09-13 14:56:05 +02:00
84a9aba764 adjust Doku with further infos new cookieid -> Control parameter 2023-09-13 14:42:12 +02:00
99af4cdfa9 bump metadata && changelog 2023-09-07 15:16:54 +02:00
eb2c7f73b9 add cookiebot essentials 2023-09-07 15:15:05 +02:00
7d12dd68a7 bump metadata && changelog 2023-09-07 15:11:04 +02:00
565f47b1ff add cookiebot essentials 2023-09-07 15:08:06 +02:00
7c6b0215a5 bump metadata && changelog 2023-08-23 17:16:58 +02:00
84e3895db8 extend Manufacturer 2023-08-23 17:12:18 +02:00
1e479503a7 [changed] 'an article has been removed from basket'-check 2023-08-23 17:09:49 +02:00
575e35ffbc [changed] 'an article has been removed from basket'-check 2023-08-18 14:07:53 +02:00
2e6acbe675 [fixed] metadata class entry 2023-08-17 10:59:57 +02:00
aae6c43786 extends changelog 2023-08-17 10:30:19 +02:00
17840d33b1 Merge remote-tracking branch 'remotes/origin/dev_1.x_manufacturer' into dev_1.x
# Conflicts:
#	metadata.php
2023-08-17 10:27:21 +02:00
a49c29d7aa add CountryObjectGetter to ThankYouController 2023-08-17 09:20:58 +02:00
e90aba2c55 add gitignore 2023-08-17 08:53:00 +02:00
ea6b63fd2f extended docs 2023-08-17 08:53:00 +02:00
6b18c50b42 add 'remove_from_cart' event 2023-08-17 08:53:00 +02:00
443b456a0d add new method for debug-check 2023-08-17 08:53:00 +02:00
216c53fa90 general structure rework, debug_mode setter 2023-08-17 08:52:58 +02:00
9e7b4653ea add deug_mode switch 2023-08-16 10:44:50 +02:00
7b1241ab97 correct naming in view_search_result 2023-08-16 09:38:03 +02:00
5355b0a7ad extend Manufacturer 2023-08-15 11:59:27 +02:00
0f15df8364 [working-state] rebuilding meta structure 2023-08-03 15:55:07 +02:00
71b743ddcc bump changelog && version to 2.10.1 2023-08-03 15:10:38 +02:00
c0206f741f add missing param to check if isRemoveFromCart 2023-08-03 15:09:12 +02:00
22bec30621 add remove_from_cart 2023-08-03 14:57:26 +02:00
49bfd5be09 bump changelog && version to 2.10.0 2023-08-02 11:55:28 +02:00
6002540268 bump changelog && version to 2.9.2 2023-06-29 08:33:07 +02:00
cc89303595 [fix-bug] wrong category method used for check 2023-06-29 08:31:57 +02:00
7062d935f4 bump changelog && metadata to 2.9.1 2023-06-27 12:16:43 +02:00
9f1deab099 [bug-fix] non-category having articles throw exception
deny method-call on no category
2023-06-27 12:15:21 +02:00
2cc0368633 bump version and changelog to 2.9.0 2023-06-27 09:53:00 +02:00
432ba54c84 bump version && changelog to 1.10.0 2023-06-27 09:48:29 +02:00
8b344ffb85 add cookiefirst 2023-06-27 09:39:43 +02:00
0009926313 revert php adjustment in composer.json 2023-06-27 09:30:10 +02:00
50be757355 reduce minimal usable php to 7.0 2023-06-27 09:08:17 +02:00
b0a1c20419 add missing cmp-entry in cmp-list 2023-06-27 08:58:05 +02:00
54fcbf88c9 add cookiefirst necessary script-attributes 2023-06-27 08:46:51 +02:00
0ae67c823b add metadata cookiefirst entry plus multilang-usability 2023-06-27 08:46:39 +02:00
ab4232fb4a add cookiefirst to manager-list 2023-06-27 08:33:49 +02:00
60f61f4bab [working state] add rel_2.x adjustments 2023-06-26 17:45:26 +02:00
a93b1cf582 [working state] add rel_2.x adjustments 2023-06-26 17:41:00 +02:00
0ec765955e bump version && changelog to 2.8.0 2023-06-23 15:15:42 +02:00
d505d8530a rm unnecessary code 2023-06-23 15:08:09 +02:00
fd79710158 add coupon to view_cart 2023-06-22 10:43:50 +02:00
d2ef663dd3 add paymentType to puchase-event
extend Basket-Model to add method to get payment-desc
2023-06-22 10:37:40 +02:00
fec30b1109 add coupon to puchase-event 2023-06-22 09:57:30 +02:00
5c53d83f32 [finished] item_category added to purchase-Event 2023-06-22 09:39:03 +02:00
8a7c25fad9 [working state] add method for article category steps
change naming of vars

Not working yet: getting of category-steps
2023-06-21 15:58:46 +02:00
429069e0cf fix wrong var usage 2023-06-21 15:56:58 +02:00
50f9fbca23 renaming vars on puchase-tpl 2023-06-21 15:47:06 +02:00
cb18feba82 add missing item_list_name 2023-06-21 15:45:12 +02:00
47b8622018 implementing Category->getSplitCategoryArray() method for category-step 2023-06-21 15:43:43 +02:00
92a91d0194 implementing Category->getSplitCategoryArray() method for category-step 2023-06-21 15:33:38 +02:00
226a80f138 implementing Category->getSplitCategoryArray() method for category-step 2023-06-21 15:29:27 +02:00
5dd7b51fb5 adjust view_cart; extend Model\Category
add categories to ecommerce-DataLayer; add method to immediately get the requested Category-Steps
2023-06-21 15:23:50 +02:00
7b82476e8b adjust view_item
add categories to ecommerce-DataLayer
2023-06-21 14:24:47 +02:00
bfc2ca8ad6 adjust view_item_list
add categories to ecommerce-DataLayer
2023-06-21 14:19:48 +02:00
e48b21022c bump version && changelog to 2.7.0 2023-06-19 15:17:43 +02:00
b4bf91660e [rework] change structure of GA-event
moving the procedere into one step so there's not an accidental triggering of an GA-Push-Event which at the end overwrites the View-Item-Push-Event in the cmpEvent
2023-06-19 14:57:12 +02:00
3f59d1f210 bump version && changelog to 1.9.0 2023-06-19 14:50:34 +02:00
5ed924e840 [rework] change structure of GA-event
moving the procedere into one step so there's not an accidental triggering of an GA-Push-Event which at the end overwrites the View-Item-Push-Event in the cmpEvent
2023-06-19 11:34:45 +02:00
3d62993dfc add missing consentmanager readme entry 2023-06-01 14:19:29 +02:00
679a49823c add missing changelog 1.x changes 2023-05-31 14:33:49 +02:00
106fea9c91 fix explicit manager bug
bug would make script apply anyway, even if no manager is found
2023-05-31 14:29:46 +02:00
d4ef0f35f9 bump version && changelog to 1.8.0 2023-05-31 14:22:11 +02:00
c17ae1cef5 fix explicit manager bug
bug would adjust the script even if the check for an own cookieManager is not set
2023-05-31 14:11:50 +02:00
13132e6da0 Merge branch 'rel_2_prep_porting_rel_1.x' of git.d3data.de:D3Public/GoogleAnalytics4 into rel_2_prep_porting_rel_1.x 2023-05-31 13:42:54 +02:00
5c478124bc bump version && changelog to 2.6.0 2023-05-31 13:40:51 +02:00
12613357b3 bump version && changelog to 2.6.0 2023-05-31 13:38:32 +02:00
95e0cab68c rework 'Manager Type Handling'; add ManagerHandler + ManagerTypes 2023-05-31 12:17:00 +02:00
1d194d445a rm unnecessary check 2023-05-31 12:16:10 +02:00
bf3fee5ce5 add missing article-getter 2023-05-31 10:35:18 +02:00
3c280a3adb adjust readme and switch used block-extension 2023-05-31 10:34:34 +02:00
6217524828 adjusted usercentrics script 2023-05-31 10:34:24 +02:00
5ef600ff2a added position to block-extension 2023-05-31 10:34:14 +02:00
a40d922f42 [working-state] restructuring usercentricts & consentmanager decision
consentmanager decision is working so far; next step is implementing usercentricts
2023-05-31 10:33:59 +02:00
dae5f66f81 add usercentrics chosable settings-value; add additional methods; add new multilang-idents 2023-05-31 10:33:43 +02:00
32e08a88ca rm typo in readme 2023-05-31 10:29:49 +02:00
9d9daf9a85 bump version && changelog to 1.7.0 2023-05-31 10:28:19 +02:00
6eefc062ba add missing article-getter 2023-05-31 10:17:51 +02:00
3f89e26bde adjust readme and switch used block-extension 2023-05-30 16:41:59 +02:00
e624cfdfcb bump version && changelog to 1.6.0 2023-05-30 08:56:19 +02:00
e2cdda530b adjusted usercentrics script 2023-05-26 13:49:50 +02:00
3e65d05c0b added position to block-extension 2023-05-24 11:09:36 +02:00
561a2101f1 [working-state] restructuring usercentricts & consentmanager decision
consentmanager decision is working so far; next step is implementing usercentricts
2023-05-23 14:52:07 +02:00
6fca52cc06 add usercentrics chosable settings-value; add additional methods; add new multilang-idents 2023-05-23 14:33:35 +02:00
347e551194 merge rel_1.x changelog 2023-05-23 11:49:09 +02:00
dfdc5d5edf bump version && changelog to 1.5.0 2023-05-23 11:44:07 +02:00
000c49c56b bump version && changelog to 2.5.0 2023-05-23 11:32:20 +02:00
ae6f9bfaa9 switch php-file-header hint 2023-05-23 10:49:59 +02:00
1d9e09b8b1 switch view_item and item_list template 2023-05-23 10:49:05 +02:00
002cc69d2a switch metadata entries; fix getPrice-bug 2023-05-23 10:06:21 +02:00
f9a0834d26 add settings-entry; add consentmanager-option 2023-05-16 14:42:12 +02:00
bb70cda626 fix unnecessary convert of int to str 2023-05-16 14:41:47 +02:00
c9a1174c98 genuine code cleanup; switch hard-getter to methods and use price-object
# Conflicts:
#	Application/views/blocks/view_item.tpl
#	Application/views/ga4/add_to_cart.tpl
2023-05-16 14:41:32 +02:00
f3b2911679 OXID UserCentrics support, general overhaul for cookie managers 2023-05-16 14:24:50 +02:00
af78809ae5 add settings-entry; add consentmanager-option 2023-05-15 15:06:25 +02:00
d531ba648b fix unnecessary convert of int to str 2023-05-12 14:08:52 +02:00
a0c650fca3 Merge branch 'rel_2.x' 2023-05-11 15:26:45 +02:00
af341a984b Merge branch 'rel_1.x'
# Conflicts:
#	CHANGELOG.md
#	metadata.php
2023-05-11 15:26:31 +02:00
122dd4cf53 genuine code cleanup; switch hard-getter to methods and use price-object 2023-05-10 15:01:56 +02:00
27798703b0 bump version && changelog to 2.4.0 2023-05-02 14:36:52 +02:00
8eb734be8a OXID UserCentrics support, general overhaul for cookie managers 2023-05-02 14:28:47 +02:00
6d155d310b bump version && changelog to 1.4.0 2023-05-02 14:21:43 +02:00
6e62f39b71 OXID UserCentrics support, general overhaul for cookie managers
taken from pull-request; thank you C. Stäblein
2023-04-04 10:15:15 +02:00
616f31ecba Merge remote-tracking branch 'remotes/origin/rel_2.x' 2023-03-20 15:46:58 +01:00
527eec1355 bump changelog 2023-03-20 11:01:03 +01:00
1966d3008e Merge remote-tracking branch 'remotes/origin/rel_2.x_custB' into rel_2.x 2023-03-20 10:56:29 +01:00
bd51b37159 hot-fix: add missing view_item file; add metadata entry 2023-03-20 09:49:49 +01:00
718b60e12c Merge remote-tracking branch 'remotes/origin/rel_2.x' 2023-03-17 15:31:34 +01:00
d4df87bfff Merge remote-tracking branch 'remotes/origin/rel_1.x' into rel_2.x 2023-03-17 15:30:03 +01:00
4222c947a9 bump versions and changelog 2023-03-17 14:49:49 +01:00
d8fa06233b adjust translation 2023-03-17 14:49:28 +01:00
4e0988307a bump readme files 2023-03-17 14:03:53 +01:00
0e55c3e38f add: Aggrosoft-Cookie-Consent compatibility 2023-03-17 10:59:50 +01:00
13df965a03 bug-fix: wrong function for pageview on thankyou page 2023-03-17 08:58:15 +01:00
1ff6f0159f rm overblowing files 2023-03-16 10:59:39 +01:00
63007e9b02 bump version 2023-03-10 11:25:12 +01:00
5fe656988c genuine cleaning off of unnecessary files (prevent confusion) 2023-03-10 11:22:49 +01:00
9cb3a54824 Merge remote-tracking branch 'remotes/origin/rel_2.x' 2023-02-22 14:35:22 +01:00
2f6fd8a31c bump version 2023-02-22 14:31:28 +01:00
8f9ed021d6 bump version 2023-02-22 14:07:14 +01:00
0ef3d3373a Merge remote-tracking branch 'remotes/origin/dev/view_cart/illegal_character_U+20AC' into rel_2.x 2023-02-22 14:05:56 +01:00
fd2b4a5bbe add special price formatting 2023-02-22 13:46:27 +01:00
1c0d55bdc3 Merge remote-tracking branch 'remotes/origin/rel_2.x' 2023-02-21 12:47:38 +01:00
7c1f99e678 Merge remote-tracking branch 'remotes/origin/rel_2.x' 2023-02-21 12:47:02 +01:00
126e746651 missing changelog-entry 2023-02-21 12:46:34 +01:00
1c45a16356 bump version 2023-02-21 12:27:52 +01:00
1589f202a9 add own cookie-check method; rm unnecessary help-text 2023-02-21 12:09:04 +01:00
55bd7b7fb4 adjust module_options meta-docs 2023-02-01 14:27:49 +01:00
3c1e6a11ff bump version 2023-01-27 13:47:13 +01:00
9ac78a0d43 OST:#573111 fix bug - missing use 2023-01-27 13:43:29 +01:00
e2bcb34051 bump version 2023-01-27 11:11:09 +01:00
4ea0c19d7b Merge remote-tracking branch 'remotes/origin/rel_1.x' into rel_2.x 2023-01-27 11:04:23 +01:00
56740f1f10 rm unnecessary method call in gtm_js.tpl 2023-01-27 09:19:05 +01:00
daed30a585 rm unnecessary entries in metadata 2023-01-27 09:07:22 +01:00
48d411ac3f switch head-meta-infos 2023-01-27 09:07:09 +01:00
b530366cb8 rm unnecessary lang file 2023-01-27 09:06:49 +01:00
975d07056a cleaning off branding 2023-01-27 08:59:06 +01:00
24bf113d30 switch comment in changelog of 2.0 2023-01-26 09:20:56 +01:00
ca6a810fa3 add 1.0 section to changelog 2023-01-26 09:16:51 +01:00
62b382eadf adding tech-docs; rm unnecessary sections in readme; fixing wrong links 2023-01-26 09:15:10 +01:00
45d8e45137 fix missing entries in changelog 2023-01-25 10:58:24 +01:00
70f2308575 extend changelog and readme 2023-01-25 10:48:02 +01:00
6eb15ec080 add block description 2023-01-20 14:31:39 +01:00
d722c46a74 bump metadata-version 2023-01-20 11:26:09 +01:00
d847a34e99 set compatibility to oxid 6.5 and above 2023-01-20 11:24:30 +01:00
7b55d1d57c adjust requirements 2023-01-20 11:18:48 +01:00
a25be1069c rework code to actually fit 6.0.x && 6.1x 2023-01-20 11:18:17 +01:00
5200232a32 Merge remote-tracking branch 'remotes/origin/rel_1.x' into dev_1.x_OXID_6.3 2023-01-20 11:11:17 +01:00
bcd785774b adjusting composer.json to fit corresponding shop-version 2022-12-22 08:56:45 +01:00
5ba613df30 add currency to the params 2022-12-21 11:12:35 +01:00
a1dc0a6a58 fix bug that'd fail in wave and fail iIndex 2022-12-09 14:51:45 +01:00
100 changed files with 3062 additions and 799 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.idea

View File

@ -1,13 +1,15 @@
<?php
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
;
$config = new PhpCsFixer\Config();
return $config->setRules([
'@PHP73Migration' => true,
'@PSR12' => true
])
->setFinder($finder)
;
$finder = PhpCsFixer\Finder::create()
->in(__DIR__)
;
$config = new PhpCsFixer\Config();
return $config->setRules([
'@PHP81Migration' => true,
'@PSR12' => true,
'php_unit_test_class_requires_covers' => true,
'doctrine_annotation_indentation' => true,
])
->setFinder($finder)
;

View File

@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace D3\GoogleAnalytics4\Application\Component\Widget;
class d3GtmStartWidget extends \OxidEsales\Eshop\Application\Component\Widget\WidgetController
{
public function render()
{
parent::render();
return '';
}
}

View File

@ -0,0 +1,85 @@
<?php
declare(strict_types=1);
namespace D3\GoogleAnalytics4\Application\Controller\Admin;
use D3\GoogleAnalytics4\Application\Model\Constants;
use D3\GoogleAnalytics4\Application\Model\ManagerHandler;
use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\ViewConfig;
class GA4AdminUserInterface_main extends \OxidEsales\Eshop\Application\Controller\Admin\AdminDetailsController
{
protected $_sThisTemplate = '@' . Constants::OXID_MODULE_ID . '/admin/d3ga4uimain';
public function render()
{
$return = parent::render();
$this->addTplParam('d3ViewObject', $this);
$this->addTplParam('d3ViewConfObject', Registry::get(ViewConfig::class));
$this->addTplParam('d3ManagerTypeArray', oxNew(ManagerTypes::class)->getManagerList());
$this->addTplParam('d3CurrentCMP', oxNew(ManagerHandler::class)->getActManager());
return $return;
}
public function save()
{
parent::save();
$aParams = Registry::getRequest()->getRequestEscapedParameter('editval');
$aCheckBoxParams = [
'_blEnableGa4',
'_blEnableDebug',
'_blEnableConsentMode',
'_blEnableOwnCookieManager',
'_blEnableMeasurementCapabilities',
'_blEnableUsercentricsConsentModeApi',
];
foreach ($aCheckBoxParams as $checkBoxName){
if (isset($aParams['bool'][$checkBoxName])){
$aParams['bool'][$checkBoxName] = true;
}else{
$aParams['bool'][$checkBoxName] = false;
}
}
$this->d3SaveShopConfigVars($aParams);
}
/**
* @param array $aParams
* @return void
*/
protected function d3SaveShopConfigVars(array $aParams)
{
$oConfig = Registry::getConfig();
foreach ($aParams as $sConfigType => $aConfigParams) {
foreach ($aConfigParams as $sParamName => $sParamValue){
if($this->d3GetModuleConfigParam($sParamName) !== $sParamValue){
$oConfig->saveShopConfVar(
$sConfigType,
Constants::OXID_MODULE_ID.$sParamName,
$sParamValue,
$oConfig->getShopId(),
Constants::OXID_MODULE_ID
);
}
}
}
}
/**
* @param string $configParamName
* @return mixed
*/
public function d3GetModuleConfigParam(string $configParamName)
{
return Registry::get(ViewConfig::class)->d3GetModuleConfigParam($configParamName);
}
}

View File

@ -0,0 +1,18 @@
<?php
declare(strict_types=1);
namespace D3\GoogleAnalytics4\Application\Model\CMP;
abstract class ConsentManagementPlatformBaseModel extends \OxidEsales\Eshop\Core\Model\BaseModel implements ConsentManagementPlatformInterface
{
public string $sCMPName;
/**
* @return string
*/
public function getCMPName(): string
{
return $this->sCMPName;
}
}

View File

@ -0,0 +1,8 @@
<?php
namespace D3\GoogleAnalytics4\Application\Model\CMP;
interface ConsentManagementPlatformInterface
{
public function getCMPName();
}

View File

@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace D3\GoogleAnalytics4\Application\Model\CMP;
use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
/**
* Used the OXID Module.
*
* Further information's:
* https://docs.oxid-esales.com/modules/usercentrics/de/latest/einfuehrung.html
*
* Usercentrics homepage:
* https://usercentrics.com
*/
class Usercentrics extends ConsentManagementPlatformBaseModel
{
public const sExternalIncludationPublicName = "( Externe Einbindung ) Usercentrics";
public const sExternalIncludationInternalName = "usercentrics";
public const sModuleIncludationPublicName = "( Modul ) Usercentrics";
public const sModuleIncludationInternalName = "oxps_usercentrics";
}

View File

@ -0,0 +1,10 @@
<?php
declare(strict_types=1);
namespace D3\GoogleAnalytics4\Application\Model;
class Constants
{
public const OXID_MODULE_ID = 'd3googleanalytics4';
}

View File

@ -0,0 +1,31 @@
<?php
namespace D3\GoogleAnalytics4\Application\Model;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\ViewConfig;
class ManagerHandler
{
/**
* @param string $sParam
* @return void
*/
public function d3SaveShopConfVar(string $sParam){
Registry::getConfig()->saveShopConfVar(
'select',
Constants::OXID_MODULE_ID."_HAS_STD_MANAGER",
$sParam,
Registry::getConfig()->getShopId(),
Constants::OXID_MODULE_ID
);
}
/**
* @return string
*/
public function getActManager() :string
{
return Registry::get(ViewConfig::class)->d3GetModuleConfigParam('_HAS_STD_MANAGER')?:"";
}
}

View File

@ -0,0 +1,72 @@
<?php
namespace D3\GoogleAnalytics4\Application\Model;
use D3\GoogleAnalytics4\Application\Model\CMP\Usercentrics;
class ManagerTypes
{
public const EXTERNAL_SERVICE = "eigener Service";
public const INTERNAL_EXTERNAL_SERVICE = "externalService";
public const NET_COOKIE_MANAGER = "Netensio Cookie Manager";
public const INTERNAL_NET_COOKIE_MANAGER = "net_cookie_manager";
/**
* Further information's:
* https://github.com/aggrosoft/oxid-cookie-compliance
*/
public const AGCOOKIECOMPLIANCE = "Aggrosoft Cookie Compliance";
public const INTERNAL_AGCOOKIECOMPLIANCE = "agcookiecompliance";
public const CONSENTMANAGER = "Consentmanager";
public const INTERNAL_CONSENTMANAGER = "cmconsentmanager";
public const COOKIEFIRST = "Cookiefirst";
public const INTERNAL_COOKIEFIRST = "cookiefirst";
public const COOKIEBOT = "Cookiebot";
public const INTERNAL_COOKIEBOT = "cookiebot";
/**
* @return array
*/
public function getManagerList(): array
{
return [
self::INTERNAL_EXTERNAL_SERVICE => self::EXTERNAL_SERVICE,
self::INTERNAL_AGCOOKIECOMPLIANCE => self::AGCOOKIECOMPLIANCE,
self::INTERNAL_NET_COOKIE_MANAGER => self::NET_COOKIE_MANAGER,
Usercentrics::sModuleIncludationInternalName => Usercentrics::sModuleIncludationPublicName,
Usercentrics::sExternalIncludationInternalName => Usercentrics::sExternalIncludationPublicName,
self::INTERNAL_CONSENTMANAGER => self::CONSENTMANAGER,
self::INTERNAL_COOKIEFIRST => self::COOKIEFIRST,
self::INTERNAL_COOKIEBOT => self::COOKIEBOT,
];
}
/**
* @param string $sManager
* @return bool
*/
public function isManagerInList(string $sManager): bool
{
return in_array($sManager, array_keys($this->getManagerList()), true);
}
/**
* @return array
*
* the CMP from this method always needs the script tag delivered to the dom.
*/
public function scriptTagDeliveredByDefaultArray(): array
{
return [
Usercentrics::sModuleIncludationInternalName,
Usercentrics::sExternalIncludationInternalName,
ManagerTypes::INTERNAL_CONSENTMANAGER,
ManagerTypes::INTERNAL_COOKIEFIRST,
ManagerTypes::INTERNAL_COOKIEBOT,
ManagerTypes::INTERNAL_EXTERNAL_SERVICE,
];
}
}

View File

@ -1,38 +0,0 @@
<?php
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
* http://www.shopmodule.com
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
* @link http://www.oxidmodule.com
*/
$style = '<style type="text/css">
.groupExp a.rc b {font-size:medium;color:#ff3600;}
.groupExp dt .txt,
.groupExp dt .select,
.groupExp dt .txtfield {width:250px !important; margin: 2px !important; padding: 1px 4px !important; border: 1px solid #ccc !important; }
.groupExp dt textarea.txtfield { min-height: 125px;}
.groupExp dl { display:block !important;}
input.confinput {position:fixed;top:20px;right:70px;background:#008B2D;padding:10px 25px;color:white;border:1px solid black;cursor:pointer;font-size:125%;}
input.confinput:hover {outline:3px solid #ff3600;}
</style>';
$aLang = [
'charset' => 'UTF-8',
'SHOP_MODULE_d3_gtm_sContainerID' => 'Container ID',
'SHOP_MODULE_GROUP_d3_gtm_settings' => 'Einstellungen',
'SHOP_MODULE_d3_gtm_blGA4enab' => 'GA4 Aktivieren',
'SHOP_MODULE_d3_gtm_blUAenabled' => 'UA Aktivieren',
'SHOP_MODULE_d3_gtm_blEnableDebug' => 'Debug-Modus aktivieren',
// for cookie manager settings
'SHOP_MODULE_GROUP_d3_gtm_settings_cookiemanager' => 'Cookie Manager Einstellungen',
'SHOP_MODULE_d3_gtm_settings_hasOwnCookieManager' => 'Eigenen Cookie Manager nutzen?',
'SHOP_MODULE_d3_gtm_settings_cookieName' => 'Cookie-Name',
];

View File

@ -0,0 +1,124 @@
<?php
$sLangName = "Deutsch";
// -------------------------------
// RESOURCE IDENTITFIER = STRING
// -------------------------------
$aLang = [
'charset' => 'UTF-8',
'd3mxgoogleanalytics4' => 'Google Analytics 4',
'd3mxgoogleanalytics4set' => 'Einstellungen',
// Base Translations
'D3BASECONFIG' => 'Grundeinstellungen',
'D3CLOSE' => 'SchlieĂźen',
'D3NONE' => '- keinen -',
'D3CONTAINERID' => 'Container-ID',
'D3CONTAINERID_HELP' => '<a target="_blank" href="https://github.com/d3datadevelopment/GoogleAnalytics4/blob/master/Docs/README.md#Container-ID" class="text-muted text-decoration-none"><i class="bi bi-book-half"></i> Was ist die <strong>Container-ID</strong>?</a>',
'D3ACTIVATEMOD' => 'Modul aktivieren',
'D3CNTRLPARAM' => 'Steuerungsparameter',
'D3CNTRLPARAM_HELP' => '<a target="_blank" href="https://github.com/d3datadevelopment/GoogleAnalytics4/blob/master/Docs/README.md#steuerungsparameter" class="text-muted text-decoration-none"><i class="bi bi-book-half"></i> Was ist der <strong>Steuerungsparameter</strong>?</a>',
'D3INACTIVATEMOD' => 'Modul ist nicht aktiv! Es werden keine Funktionen ausgespielt!',
// Usercentrics Dynamische Optionen
'D3USRCNTRCSDYNOPT' => 'Usercentrics Dynamische Optionen',
// Use debug mode?
'D3USEDEBUGMODE' => "Debug-Modus aktivieren",
'D3USEDEBUGMODE_HELP' => "Der <strong>Debug Modus</strong> setzt an alle DataLayer ( also Daten Sammlungen im Frontend )
<strong>'debug_mode': 'true'</strong> und ermöglicht im Google Tag Manager selbst ein detaillierteres
Auswerten des einflieĂźenden Datenstroms.",
// Use Consentmode?
'D3USEGOOGLECONSENTMODE' => "Google Consent Mode 'Default Values' akivieren",
'D3USEGOOGLECONSENTMODE_HELP' => "Der <trong>Consent Mode 'Default Values'</trong> setzt im Frontend,
vor jedem Sammeln und Senden von Daten, einen Befehl der die Bearbeitung der Daten fortlaufend verändert.<br>
<br>
Diese Veränderte Berarbeitung heißt im Detail, dass der Google Tag Manager ( GTM )
bzw. in erster Instanz die Consent Management Platform ( CMP ) keine Daten zur Verarbeitung an Google sendet,
bis ein entsprechendes Zustimmungs-Signal vom Kunden explizit erteilt wurde.<br>
Die CMP ist sogar derartig restriktiv, dass diese den Datenstrom zum GTM ( Vorinstanz zu Google Analytics )
völlig verhindert, solange keine Zustimmung erteilt wurde.<br>
<br>
Ein einfaches anschalten dieser Funktion regelt noch <strong>nicht</strong> die völlige Funktionsweise
aller beteiligten Instanzen; diese bedarf eine detailliertere Konfiguration!<br>",
// Use CMP?
'D3CMPTABTITLE' => 'Cookie Manager Einstellungen',
'D3CMPUSEQ' => 'Consent Management Platform ( CMP ) nutzen?',
'D3CMPUSEQ_HELP' => '"Eine Consent Management Platform ( CMP ) ist eine Software, mit der Website-Betreiber
oder Anbieter von Web-Apps ĂĽber ein Banner oder ein Pop-up eine datenschutzrechtliche
Einwilligung der Besucher einholen und speichern, bevor Nutzerdaten ĂĽber
Website-Skripte erfasst werden (Tracking)." <a target="_blank" href="https://de.wikipedia.org/wiki/Consent_Management_Platform">Wikipedia Beschreibung</a><br>
<br>
Um Google Analytics 4 ( <a target="_blank" href="https://marketingplatform.google.com/intl/de/about/analytics/">Google Analytics</a> ) weiterhin nutzen zu können,
und dank fortschreitendem Datenschutz unserer personenbezogener Daten, ist das Nutzen eines konformen CMP
heute zwangläufig nötig.<br>
<br>
Diese konformen CMP sind in
<a target="_blank" href="https://cmppartnerprogram.withgoogle.com/">offizieller Partnerschaft mit Google ( Liste der Partner )</a>
und unterliegen strengen Vorschriften, um ein ordnungsgemäßes Senden und
Verarbeiten der Zustimmung unterliegenden Daten sicher stellen zu können.',
'D3CMP' => 'Consent Management Platform ( CMP ) wählen',
// Usercentrics Config
// activate Individual Default Values
'D3USRCNTRCSCFG_ACT_INDIVDEFVAL' => "Usercentrics individual 'Default Values' aktiveren",
// standard Consent
'D3USRCNTRCSCFG_STD_CNST' => "GTM Standard Consent",
// activate consent mode API
'D3USRCNTRCSCFG_ACT_CNSTMDE_API' => "Usercentrics Consent Mode API aktivieren",
// consent mode api
'D3USRCNTRCSCFG_CNSTMDE_API' => "Consent Mode API",
'D3USRCNTRCSCFG_DOCS' => 'Nähere Infos zu den hier konfigurierbaren Einstellungen entnehmen Sie bitte der offiziellen
Dokumentation von Usercentrics selbst: <a target="_blank" href="https://docs.usercentrics.com/#/consent-mode" class="text-primary"><i class="bi bi-book-half"></i> Dokumentation</a>',
'D3USRCNTRCSCFG_WARNING' => "Bevor Sie hier Anpassungen machen, konsultieren Sie bitte einen technischen Support!<br>
Anpassungen können zu Beeinträchtigungen und Ausfall von Funktionen im Frontend führen!",
// Additional Config
// Server-Side tagging
'D3SERVERSIDETAGGING' => 'Server-Side tagging',
'D3DETAILED_DESC' => 'Detailliertere Erklärung der Funktion',
'D3SERVERSIDETAGGING_HINT' => 'Die Conatiner-ID wird weiterhin unter "Grundeinstellungen" eingetragen!<br><br>
"Serverseitiges Tagging ist eine neue Möglichkeit, mit Google Tag Manager Ihre Anwendung geräteübergreifend zu verwalten.<br>
Servercontainer verwenden dasselbe Tag-, Trigger- und Variablenmodell, das Sie gewohnt sind.<br>
Außerdem bieten sie neue Tools, mit denen Sie Nutzeraktivitäten überall messen können." <br>
<br>
- Quelle <a href="https://developers.google.com/tag-platform/tag-manager/server-side/intro">Developers-Google Server-Side tagging</a><br>
<br>
<strong>Verändern Sie die Werte nur, wenn Sie Server-Side tagging verwenden wollen! Gegebenenfalls fragen Sie einen technischen Ansprechpartner.</strong>
',
'D3SERVERSIDETAGGING_TITLE_ACTIVE' => 'AusfĂĽhrender code',
'D3SERVERSIDETAGGING_ACTIVE' => 'Diese Domain wird im <strong>aktiven</strong>-code ausgefĂĽht. Das heiĂźt,
dass es sich hierbei um das HTML-Tag <code>script</code> handelt.
Dieses kĂĽmmert sich darum, dass die im DataLayer
zusammengefassten Daten an den GTM weitergeleitet werden.<br>
<br>
<h4>Folgend eine Darstellung, was genau ausgetauscht wird</h4>
<pre>
<code>
Vorher:
https://www.googletagmanager.com/gtm.js?id=
Nachher:
{Domain}?id=
</code>
</pre>',
'D3SERVERSIDETAGGING_TITLE_PASSIVE' => '<u>nicht</u>&nbsp;AusfĂĽhrneder code',
'D3SERVERSIDETAGGING_PASSIVE' => 'Diese Domain wird im <strong>passiven</strong>-code ausgefĂĽht. Das heiĂźt,
dass es sich hierbei um das HTML-Tag <code>noscript</code> handelt.
Dieses wird ausgefĂĽhrt, wenn aus einem bestimmten Grund
das Javascript nicht ausgefĂĽhrt wird.<br>
( keine Cookies erlaubt, JavaScript-Unterbindung, ... )
<br>
<h4>Folgend eine Darstellung, was genau ausgetauscht wird</h4>
<pre>
<code>
Vorher:
src="https://www.googletagmanager.com/ns.html?id={Container-ID}"
Nachher:
src="{Domain}?id={Container-ID}"
</code>
</pre>',
];

View File

@ -0,0 +1,111 @@
<?php
/**
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
use D3\GoogleAnalytics4\Application\Model\Constants as Constants;
$style = '<style type="text/css">
.groupExp a.rc b {font-size:medium;color:#ff3600;}
.groupExp dt .txt,
.groupExp dt .select,
.groupExp dt .txtfield {width:250px !important; margin: 2px !important; padding: 1px 4px !important; border: 1px solid #ccc !important; }
.groupExp dt textarea.txtfield { min-height: 125px;}
.groupExp dl { display:block !important;}
input.confinput {position:fixed;top:20px;right:70px;background:#008B2D;padding:10px 25px;color:white;border:1px solid black;cursor:pointer;font-size:125%;}
input.confinput:hover {outline:3px solid #ff3600;}
</style>';
$aLang = [
'charset' => 'UTF-8',
// STD-Einstellungen
'SHOP_MODULE_GROUP_'.Constants::OXID_MODULE_ID.'_settings' => 'Einstellungen',
'SHOP_MODULE_'. Constants::OXID_MODULE_ID.'_sContainerID' => 'Container ID',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_blGA4enab' => 'GA4 Aktivieren',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_blUAenabled' => 'UA Aktivieren',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_blEnableDebug' => 'Debug-Modus aktivieren',
// Serverside - tagging
'SHOP_MODULE_GROUP_'.Constants::OXID_MODULE_ID.'_serversidetagging' => 'Server-Side tagging',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_serversidetagging_js' => 'Servercontainer AusfĂĽhrender-Code',
'HELP_SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_serversidetagging_js' => 'Diese Domain wird im <strong>aktiven</strong>-code ausgefĂĽht. Das heiĂźt,
dass es sich hierbei um das HTML-Tag <code>script</code> handelt.
Dieses kĂĽmmert sich darum, dass die, im data_layer
zusammengefassten Daten an den GTM weitergeleitet werden.<br>
<br>
<h4>Folgend eine Darstellung, was genau ausgetauscht wird</h4>
<pre>
<code>
Vorher:
https://www.googletagmanager.com/gtm.js?id=
Nachher:
{Domain}?id=
</code>
</pre>
Die Conatiner-ID wird weiterhin im Punkt "Einstellung" eingetragen!
',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_serversidetagging_nojs' => 'Servercontainer NICHT AusfĂĽhrender-Code<br><br>
"Serverseitiges Tagging ist eine neue Möglichkeit, mit Google Tag Manager Ihre Anwendung geräteübergreifend zu verwalten.<br>
Servercontainer verwenden dasselbe Tag-, Trigger- und Variablenmodell, das Sie gewohnt sind.<br>
Außerdem bieten sie neue Tools, mit denen Sie Nutzeraktivitäten überall messen können." <br>
<br>
- Quelle <a href="https://developers.google.com/tag-platform/tag-manager/server-side/intro">Developers-Google Server-Side tagging</a><br>
<br>
<strong>Verändern Sie die Werte nur, wenn Sie Server-Side tagging verwenden wollen!</strong>
',
'HELP_SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_serversidetagging_nojs' => 'Diese Domain wird im <strong>passiven</strong>-code ausgefĂĽht. Das heiĂźt,
dass es sich hierbei um das HTML-Tag <code>noscript</code> handelt.
Dieses wird ausgefĂĽhrt, wenn aus einem bestimmten Grund
das Javascript nicht ausgefĂĽhrt wird.<br>
( keine Cookies erlaubt, JavaScript-Unterbindung, ... )
<br>
<h4>Folgend eine Darstellung, was genau ausgetauscht wird</h4>
<pre>
<code>
Vorher:
src="https://www.googletagmanager.com/ns.html?id={Container-ID}"
Nachher:
src="{Domain}?id={Container-ID}"
</code>
</pre>
Die Conatiner-ID wird weiterhin im Punkt "Einstellung" eingetragen!
',
// for cookie manager settings
'SHOP_MODULE_GROUP_'.Constants::OXID_MODULE_ID.'_cookiemanager' => 'Cookie Manager Einstellungen',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_hasOwnCookieManager' => 'Cookie Manager nutzen?',
'HELP_SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER' => 'Mehr Informationen zu den genannten Coookie-Manager finden Sie auf den folgenden Home-Pages<br><br>
<a href="https://consentmanager.net/">Consentmanager</a><br>
<a href="https://usercentrics.com/">Usercentrics</a><br>
<a href="https://cookiefirst.com">Cookiefirst</a><br>
<hr>
Bei weiteren Fragen stehen wir gern zur VerfĂĽgung! Kontaktieren Sie uns einfach unter <a href="https://www.d3data.de/">https://www.d3data.de/</a>',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER' => 'Nutzen Sie eine der folgenden Einbindungen?<br>
Dann wählen Sie bitte die zutreffende aus.',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER_NONE' => '---',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER_CONSENTMANAGER' => 'consentmanager',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER_USERCENTRICS' => 'usercentrics',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER_COOKIEFIRST' => 'cookiefirst',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_HAS_STD_MANAGER_COOKIEBOT' => 'Cookiebot',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_controlParameter' => 'Steuerungsparameter',
'HELP_SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_controlParameter' => 'Nähere infos zum <a target="_blank" href="https://git.d3data.de/D3Public/GoogleAnalytics4/src/branch/master/Docs">"<strong>Steuerungsparameter</strong>"</a><hr>
<strong>Beachte:</strong><br>
Sofern Sie die <a target="_blank" href="https://consentmanager.net" style="color: blue">consentmanager</a> CMP verwenden,
bitte ich Sie, grĂĽndlichst, die Hinweise der <a target="_blank" href="https://git.d3data.de/D3Public/GoogleAnalytics4/src/branch/master/Docs/CMP/consentmanager.md">Moduldokumentation/Consentmanager</a> zu lesen.
',
'SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_blActivateConsentMode' => "Google Consent Mode 'Default Values' aktivieren",
'HELP_SHOP_MODULE_'.Constants::OXID_MODULE_ID.'_blActivateConsentMode' => 'Diese Einstellung ist zu aktivieren, wenn Sie den Google-Consent-Mode ( Einwilligungsmodus ) verwenden wollen.
<hr>
"Im Einwilligungsmodus können Sie Google über den Cookie- oder App-ID-Einwilligungsstatus Ihrer Nutzer informieren.
Mit Tags wird das Verhalten angepasst. Dabei werden die Einstellungen der Nutzer berĂĽcksichtigt." ~ <a href="https://support.google.com/google-ads/answer/10000067">Google Einwilligungsmodus</a>',
];

View File

@ -1,59 +0,0 @@
[{assign var="d3VtConfigObject" value=$oViewConf->getConfig()}]
[{if $d3VtConfigObject->getConfigParam('d3_gtm_settings_hasOwnCookieManager')}]
[{if $oViewConf->D3blAcceptedCookie($d3VtConfigObject->getConfigParam('d3_gtm_settings_cookieName'))}]
[{if $oViewConf->getGtmContainerId()}][{strip}]
<!-- Google Tag Manager -->
<script>
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({'gtm.start': new Date().getTime(), event: 'gtm.js'});
var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : '';
j.async = true;
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', '[{$oViewConf->getGtmContainerId()}]');
</script>
<!-- End Google Tag Manager -->
[{if $oViewConf->getTopActionClassName() === "alist" }]
[{* include file="ga4_view_item_list.tpl" gtmCategory=$oView->getActiveCategory() gtmProducts=$oView->getArticleList() listtype=$oView->getListType() *}]
[{elseif $oViewConf->getTopActionClassName() === "details" }]
[{* include file="ga4_view_item.tpl" gtmProduct=$oView->getProduct() *}]
[{elseif $oViewConf->getTopActionClassName() === "search" }]
[{elseif $oViewConf->getTopActionClassName() === "basket" }]
[{/if}]
[{/strip}][{/if}]
[{else}]
<script>
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
</script>
[{/if}]
[{else}]
[{if $oViewConf->getGtmContainerId()}][{strip}]
<!-- Google Tag Manager -->
<script>
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({'gtm.start': new Date().getTime(), event: 'gtm.js'});
var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : '';
j.async = true;
j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', '[{$oViewConf->getGtmContainerId()}]');
</script>
<!-- End Google Tag Manager -->
[{if $oViewConf->getTopActionClassName() === "alist" }]
[{* include file="ga4_view_item_list.tpl" gtmCategory=$oView->getActiveCategory() gtmProducts=$oView->getArticleList() listtype=$oView->getListType() *}]
[{elseif $oViewConf->getTopActionClassName() === "details" }]
[{* include file="ga4_view_item.tpl" gtmProduct=$oView->getProduct() *}]
[{elseif $oViewConf->getTopActionClassName() === "search" }]
[{elseif $oViewConf->getTopActionClassName() === "basket" }]
[{/if}]
[{/strip}][{/if}]
[{/if}]
[{$smarty.block.parent}]

View File

@ -1,8 +0,0 @@
[{if $oViewConf->getGtmContainerId()}][{strip}]
<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe src="https://www.googletagmanager.com/ns.html?id=[{$oViewConf->getGtmContainerId()}]"
height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->[{/strip}][{/if}]
[{$smarty.block.parent}]

View File

@ -1,66 +0,0 @@
[{$smarty.block.parent}]
[{*
[{strip}]
[{assign var="gtmProduct" value=$oView->getProduct()}]
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
[{if !$head }]
[{assign var=$head value=$oView->getViewParameter('head')}]
[{/if}]
<script>
var gtmItem = {
'id': '[{$gtmProduct->oxarticles__oxartnum->value}]',
'item_id': '[{$gtmProduct->oxarticles__oxartnum->value}]',
'name': '[{$gtmProduct->oxarticles__oxtitle->value}]',
'item_name': '[{$gtmProduct->oxarticles__oxtitle->value}]',
'variant': '[{if $gtmProduct->oxarticles__oxvarselect->value}][{$gtmProduct->oxarticles__oxvarselect->value}][{/if}]',
'item_variant': '[{if $gtmProduct->oxarticles__oxvarselect->value}][{$gtmProduct->oxarticles__oxvarselect->value}][{/if}]',
'brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
'price': [{$gtmProduct->oxarticles__oxprice->value}],
'category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]no category[{/if}]',
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]no category[{/if}]',
[{if $listId == 'productList' || $listId == 'categoryList'}]
/* category list */
'list': '[{$listId}]',
'item_list_id': '[{$listId}]',
'item_list_name': '[{$head}]',
[{elseif $listId}]
/* category list */
'list': '[{$listId}]',
'promotion_id': '[{$listId}]',
'promotion_name': '[{$head}]',
[{/if}]
'position': [{$iIndex}],
'index': [{$iIndex}],
'quantity': '1'
};
/* UA */
dataLayer.push({ ecommerce: null });
dataLayer.push({
'event': 'UA_event',
'event_name': 'Impression',
'ecommerce': {
'currencyCode': '[{$currency->name}]',
'impressions': [gtmItem]
}
});
/* GA4 */
dataLayer.push({ ecommerce: null });
dataLayer.push({
'event': 'GA4_event',
'event_name': 'view_item_list',
'ecommerce': {
'items': [gtmItem]
}
});
</script>
[{/strip}]
*}]

View File

@ -1,5 +0,0 @@
[{if $oxcmp_basket->isNewItemAdded() && $smarty.session._newitem}]
<!-- [{$smarty.session._newitem|@var_dump}] -->
[{* include file="ga4_add_to_cart.tpl" gtmProduct=$smarty.session._newitem *}]
[{/if}]
[{$smarty.block.parent}]

View File

@ -1,33 +0,0 @@
[{$smarty.block.parent}]
[{*$oxcmp_basket|get_class_methods|dumpvar*}]
[{assign var='gtmCartArticles' value=$oView->getBasketArticles()}]
[{strip}][{capture assign=d3_ga4_view_cart}]
let iPrice = "[{oxprice price=$oxcmp_basket->getPrice()}]";
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'view_cart',
'eventLabel':'Checkout Step 1',
'ecommerce': {
'actionField': "step: 1",
'currency': "[{$currency->name}]",
'value': iPrice.replace("€", ""),
'items': [
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
[{assign var='_price' value=$basketitem->getUnitPrice()}]
{
'item_id': '[{$gtmCartArticles[$basketindex]->oxarticles__oxartnum->value}]',
'item_name': '[{$gtmCartArticles[$basketindex]->oxarticles__oxtitle->value}]',
'item_variant': '[{$gtmCartArticles[$basketindex]->oxarticles__oxvarselect->value}]',
'price': [{$_price->getPrice()}],
'quantity':[{$basketitem->getAmount()}],
'position':[{$smarty.foreach.gtmCartContents.index}]
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
[{/foreach}]
]
}
});
[{/capture}][{/strip}]
[{oxscript add=$d3_ga4_view_cart}]

View File

@ -1,18 +0,0 @@
[{strip}]
<script>
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event':'ee.checkout',
'eventLabel':'Checkout Step 2',
'ecommerce': {
'checkout': {
'actionField': {
'step': 2,
'option':'[{oxmultilang ident="vt_GTM_EE_LOGINOPTION"|cat:$oView->getLoginOption()}]'
}
}
}
});
</script>
[{/strip}]
[{$smarty.block.parent}]

View File

@ -1,9 +0,0 @@
<script>
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'ee.checkout',
'eventLabel': 'Checkout Step 3',
'ecommerce': {'checkout': {'actionField': {'step': 3}}}
});
</script>
[{$smarty.block.parent}]

View File

@ -1,9 +0,0 @@
<script>
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
"event": "ee.checkout",
'eventLabel': 'Checkou Step 4',
"ecommerce": {"checkout": {"actionField": {"step": 4}}}
});
</script>
[{$smarty.block.parent}]

View File

@ -1,35 +0,0 @@
[{$smarty.block.parent}]
[{strip}]
<script>
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
[{assign var="_gtmOrder" value=$oView->getOrder()}]
[{assign var="_gtmArticles" value=$_gtmOrder->getOrderArticles()}]
dataLayer.push({
'event': 'purchase',
'eventLabel':'Checkout Step 5',
'ecommerce': {
'transaction_id': '[{$_gtmOrder->oxorder__oxordernr->value}]',
'affiliation': '[{$oxcmp_shop->oxshops__oxname->value}]',
'value': '[{$_gtmOrder->oxorder__oxtotalordersum->value}]',
'tax': '[{math equation="x+y" x=$_gtmOrder->oxorder__oxartvatprice1->value y=$_gtmOrder->oxorder__oxartvatprice2->value }]',
'shipping': '[{$_gtmOrder->oxorder__oxdelcost->value}]',
'currency': '[{$_gtmOrder->getFieldData('oxcurrency')}]',
'items':
[
[{foreach from=$_gtmArticles item="_gtmArticle" name="gtmArticles"}]
{
'id': '[{$_gtmArticle->oxorderarticles__oxartnum->value}]',
'name': '[{$_gtmArticle->oxorderarticles__oxtitle->value}]',
'variant': '[{$_gtmArticle->oxorderarticles__oxselvariant->value}]',
'price': [{$_gtmArticle->oxorderarticles__oxprice->value}],
'quantity': [{$_gtmArticle->oxorderarticles__oxamount->value}],
'position': [{$smarty.foreach.gtmArticles.iteration}]
}[{if !$smarty.foreach.gtmArticles.last}],[{/if}]
[{/foreach}]
]
}
})
</script>
[{/strip}]

View File

@ -1,25 +0,0 @@
[{$smarty.block.parent}]
[{assign var="gtmProduct" value=$oView->getProduct()}]
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
<script>
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'view_item',
'eventLabel':'Product View',
'ecommerce': {
'currency': '[{$currency->name}]',
'items': [
{
'item_name': '[{$gtmProduct->oxarticles__oxtitle->value}]',
'item_id': '[{$gtmProduct->oxarticles__oxartnum->value}]',
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
'item_variant': '[{if $gtmProduct->oxarticles__oxvarselect->value}][{$gtmProduct->oxarticles__oxvarselect->value}][{/if}]',
'price': [{$gtmProduct->oxarticles__oxprice->value}]
}
]
}
});
</script>

View File

@ -1,35 +0,0 @@
[{$smarty.block.parent}]
[{assign var="gtmProduct" value=$oView->getProduct()}]
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
<script>
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'ee.impression',
'eventLabel':'Impression',
'ecommerce': {
'currencyCode': '[{$currency->name}]',
'impressions': [
{
'name': '[{$gtmProduct->oxarticles__oxtitle->value}]',
'id': '[{$gtmProduct->oxarticles__oxartnum->value}]',
'price': [{$gtmProduct->oxarticles__oxprice->value}],
'brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
'category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
'variant': '[{if $gtmProduct->oxarticles__oxvarselect->value}][{$gtmProduct->oxarticles__oxvarselect->value}][{/if}]'
[{if $list && $position}],
'list': '[{$list}]',
'position': [{"_"|str_replace:"":$position}]
[{/if}]
}
]
}
});
</script>
<!--
sWidgetType [{$sWidgetType}] | [{$oView->getViewParameter('sWidgetType')}]
sListType [{$sListType}] | [{$oView->getViewParameter('sListType')}]
iIndex [{$iIndex}] | [{$oView->getIndex()}]
listId [{$listId}] | [{$oView->getViewParameter('listId')}]
testid [{$testid}] | [{$oView->getViewParameter('testid')}]
-->

View File

@ -1,59 +0,0 @@
[{$smarty.block.parent}]
[{*$gtmProduct|get_class_methods|dumpvar*}]
[{capture assign=d3_ga4_add_to_cart}]
[{block name="d3_ga4_add_to_basket"}]
$("#toBasket").click(function(event) {
[{*event.preventDefault();*}]
let iArtQuantity = $("#amountToBasket").val();
dataLayer.push({
'isAddToBasket': true,
'event':'add_to_cart',
'eventLabel': 'add_to_cart',
'ecommerce': {
'currency': "[{$currency->name}]",
'value': iArtQuantity*[{$gtmProduct->getFieldData('oxprice')}],
'items': [
{
'item_id': '[{$gtmProduct->getFieldData('oxartnum')}]',
'item_name': '[{$gtmProduct->getFieldData('oxtitle')}]',
'price': '[{$gtmProduct->getFieldData('oxprice')}]',
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
'item_variant': '[{if $gtmProduct->getFieldData('oxvarselect')}][{$gtmProduct->getFieldData('oxvarselect')}][{/if}]',
'item_category': itemCategories[0] || 'no category',
'item_category_2':itemCategories[1] || '',
'item_category_3':itemCategories[2] || '',
'item_category_4':itemCategories[3] || '',
[{if false}]
[{* ??? what *}]
'item_list_name': 'Search Results', // If associated with a list selection.
'item_list_id': 'SR123', // If associated with a list selection.
'index': 1, // If associated with a list selection.
[{/if}]
'quantity': iArtQuantity
}
]
}
});
});
[{/block}]
[{/capture}]
[{oxscript add=$d3_ga4_add_to_cart}]
[{strip}]
[{* variable $gtmProduct is passed from parent tempalte *}]
[{assign var="gtmCurrency" value=$oView->getActCurrency()}]
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
<script>
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
let itemCategories = '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]no category[{/if}]'.split('/');
</script>
[{/strip}]

View File

@ -1,36 +0,0 @@
[{strip}]
<script type="text/javascript">
window.dataLayer = window.dataLayer || [];
dataLayer.push({ ecommerce: null });
dataLayer.push({
[{assign var="oBasket" value=$order->getBasket()}]
[{assign var="iVat" value=0}]
'event':'purchase',
'ecommerce':{
'purchase':{
'actionField':{
'id': [{$order->getFieldData('oxordernr')}],
'ordernr': [{$order->getFieldData('oxtotalordersum')}],
'tax': [{$order->d3GetSumOrderVat()}],
'shipping': [{$order->getFieldData('oxdelcost')}],
'currency': "[{$order->getFieldData('oxcurrency')}]"
},
'products':[
[{foreach from=$order->getOrderArticles() item=listItem}]
[{assign var="orderArticle" value=$listItem->getArticle()}]
{
'item_id': "[{$listItem->getFieldData('oxartnum')}]",
'item_name': "[{$listItem->getFieldData('oxtitle')}]",
'currency': "[{$order->getFieldData('oxcurrency')}]",
'articleVat': [{$orderArticle->getArticleVat()}],
'price': [{$orderArticle->getBasePrice()}],
'quantity': [{$listItem->getFieldData('oxamount')}]
},
[{/foreach}]
]
}
}
});
</script>
[{/strip}]

View File

@ -1,32 +0,0 @@
[{$smarty.block.parent}]
[{assign var="gtmProducts" value=$oView->getArticleList()}]
[{if $gtmProducts|@count}]
[{strip}]
<script>
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'view_search_result',
'eventLabel':'view_search_result',
'ecommerce': {
'search_term': '[{$searchparamforhtml}]',
'items': [
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
[{if !$gtmCategory}][{assign var="gtmCategory" value=$gtmProduct->getCategory()}][{/if}]
{
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
'price': [{$gtmProduct->oxarticles__oxprice->value|default:'0'}],
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
'quantity': 1
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
[{/foreach}]
]
}
});
</script>
[{/strip}]
[{/if}]

View File

@ -1,26 +0,0 @@
[{strip}]
[{* variable $gtmProduct is passed from parent tempalte *}]
[{assign var="gtmCurrency" value=$oView->getActCurrency()}]
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
<script type="text/javascript">
dataLayer.push({ecommerce: null});
dataLayer.push({
'event':'GA4_event',
'event_name': 'view_item',
'ecommerce': {
'items': [
{
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
'item_variant': '[{if $gtmProduct->oxarticles__oxvarselect->value}][{$gtmProduct->oxarticles__oxvarselect->value}][{/if}]',
'price': [{$gtmProduct->oxarticles__oxprice->value|default:0}],
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
'quantity': '1'
}
]
}
});
</script>
[{/strip}]

View File

@ -1,34 +0,0 @@
[{assign var="gtmProducts" value=$products}]
[{assign var="breadCrumb" value=''}]
[{if $gtmProducts|@count}]
[{strip}]
<script>
/* ga4 */
dataLayer.push({ecommerce: null});
dataLayer.push({
'event':'view_item_list',
'event_name': 'view_item_list',
'ecommerce': {
'item_list_id': '[{$oView->getCategoryId()}]',
'item_list_name': '[{foreach from=$oView->getBreadCrumb() item=sCrum}][{if $sCrum.title }][{$breadCrumb|cat:$sCrum.title|cat:" > "}][{/if}][{/foreach}]',
'items': [
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
[{if !$gtmCategory}][{assign var="gtmCategory" value=$gtmProduct->getCategory()}][{/if}]
{
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
'price': [{$gtmProduct->oxarticles__oxprice->value|default:'0'}],
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
'item_category': '[{if $gtmCategory}][{$gtmCategory->getLink()|parse_url:5|ltrim:"/"|rtrim:"/"}][{else}]-[{/if}]',
'quantity': 1
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
[{/foreach}]
]
}
});
</script>
[{/strip}]
[{/if}]

View File

@ -4,6 +4,360 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [unreleased](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/3.0.0.1...rel_3.x) - 2025-x
## [3.0.0.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/3.0.0.0...3.0.0.1) - 2024-03-19
### Fixed
- reset of cmp-selection
- over-engineered getter-methods
## [3.0.0.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.22.0...3.0.0.0) - 2024-11-25
### Added
- installability OXID 7
- don't submit item prices, if user doesn't have "show price" right
## [2.23.0.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.23.0.1...2.23.0.2) - 2025-03-19
### Fixed
- reset of cmp-selection
- over-engineered getter-methods
## [2.23.0.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.23.0.0...2.23.0.1) - 2025-02-19
### Fixed
- false metadata view_cart entry
- missing menu-translation
### Added
- data layer doesn't contain prices if current user hasn't "show price" rights
## [2.23.0.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.22.0...2.23.0.0) - 2024-12-21
### Added
- another tag-versioning position
- additional global variables, if given
## [2.22.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.21.0...2.22.0) - 2024-09-21
### Fixed
- Consentmanager didn't get delivered
### Changed
- write "internal_names" of CMP to constants
## [2.21.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.20.1...2.21.0) - 2024-09-19
### Fixed
- missing parameters for widget.php call
## [2.20.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.20.0...2.20.1) - 2024-09-11
### Fixed
- missing currency name in begin_checkout template
## [2.20.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.19.0...2.20.0) - 2024-08-20
### Added
- new event "begin_checkout"
- new event "add_payment_info"
## [2.19.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.18.2...2.19.0) - 2024-08-10
### Fixed
- usage of not yet existing function
## [2.18.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.18.1...2.18.2) - 2024-06-25
### Fixed
- oe-console apply-configuration triggers on-activate and overwrites existing values
## [2.18.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.18.0...2.18.1) - 2024-06-04
### Fixed
- missing return statement, on null/ none
## [2.18.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.2...2.18.0) - 2024-06-03
### Added
- trait for generalized method
- new admin UI
- additional check for properly activated module
- admin headitem alternative
- usercentrips step/ option 2
- group CMP-Functionalities/ properties into own Model
- additional help texts, translations, explanations
- extended docs
- auto safe on first approach ga4 + cmp-mod
- onActivate/ onDeactivate
## Changed
- declare module settings consistency
- configParamGetter
- clear dead code
- template code upgrade
- lang text
- amount of save-buttons
- Usercentrics-Class constants and adjust global-module-code to it
- CMP-output in tpl
- clear code and adjust Naming
## Fixed
- false class-property declaration
- wrong to-save param
## Removed
- deprecated and obsolete module-settings
- false composer xml-excludation
## [2.17.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.1...2.17.2) - 2024-04-11
### Fixed
- error on missing necessary-component
## [2.17.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.17.0...2.17.1) - 2024-04-10
### Fixed
- second call of getGtmContainerId() ( returned false )
## [2.17.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.16.0...2.17.0) - 2024-04-10
### Added
- Google-Analytics default values
- default values switch ( admin module settings )
- translations
## Changed
- centralized metadata-id
## [2.16.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.15.0...2.16.0) - 2024-03-20
### Added
- ( Google ) Server-Side tagging usability
## [2.15.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.14.0...2.15.0) - 2024-02-05
### Fixed
- missing Component-ArticleDetails extension, missing ManufacturerListController extension
## [2.14.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.13.1...2.14.0) - 2023-01-22
### Added
- add_to_cart Event to several new shop-pages (landing-page, Account, category article-list, start)
- PHPStan code-cleanup
### Changed
- template structure
- code cleanup
## [2.13.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.13.0...2.13.1) - 2023-01-03
### Fixed
- error on array-count at zero entries
## [2.13.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.12.0...2.13.0) - 2023-09-13
### Added
- extended Docs
### Changed
- control-param name
- control-param function
- adjusted check for set control-param
- consentmanager-script-adjustments
## [2.12.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.11.1...2.12.0) - 2023-09-07
### Added
- cookiebot functionality
## [2.11.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.10.1...2.11.0) - 2023-08-23
### Added
- manufacturer extension
- working debug_mode
### Changed
- check for 'article has been removed'
- general template cleanup
## [2.10.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.10.0...2.10.1) - 2023-08-03
### Added
- missing param to identify the event
## [2.10.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.9.2...2.10.0) - 2023-08-02
### Added
- new Event "remove_from_cart"
## [2.9.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.9.1...2.9.2) - 2023-06-29
### Fixed
- wrong variable for category-object check
## [2.9.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.9.0...2.9.1) - 2023-06-27
### Fixed
- deny method call on no category
## [2.9.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.8.0...2.9.0) - 2023-06-27
### Added
- Cookiefirst usability
## [2.8.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.7.0...2.8.0) - 2023-06-23
### Added
- Method to get the in order used Payment-Name
- Method to get the current Article Category
- Following Entries to dedicated event-templates
- coupon
- paymentType
- item_list_name
- item_category
### Changed
- all used template-files have a more dedicated name
- general code cleanup
## [2.7.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.6.0...2.7.0) - 2023-06-19
### Changed
- add_to_cart event template-structure
## [2.6.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.5.0...2.6.0) - 2023-05-31
### Added
- add settings to explicit choose an external service (usercentrics/ consentmanager)
- position to block-extension
- extended instructions to check for in readme
### Fixed
- usercentrics script
- missing right articleList-getter
### Changed
- view_item_list-template block extension
- cookieManager handling
### Removed
- additional check for cookieManagerType
## [2.5.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.4.0...2.5.0) - 2023-05-23
### Added
- additional settings to explicitly indicate that consentmanager is used
### Fixed
- unnecessary converting of int to str
- missing PriceObject-bug
### Changed
- genuine code cleanup
## [2.4.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.3.3...2.4.0) - 2023-05-02
### Added
- "OXID Cookie Management powered by usercentrics" compatibility
- usercentrics defined script attributes
- cookie-manager evaluation
### Changed
- genuine clean up of base-js-files
## [2.3.3](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.3.2...2.3.3) - 2023-03-20
### Fixed
- metadata file path for view_item
## [2.3.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.2.2...2.3.2) - 2023-03-17
### Added
- Aggrosoft-Cookie-Consent compatibility
### Fixed
- wrong function for pageview on thankyou page
### Deleted
- unused files
## [2.2.2](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.2.1...2.2.2) - 2023-02-22
### Fixed
- price formatting in view_cart
## [2.2.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.1.1...2.2.1) - 2023-02-21
### Added
- cookie handling
## [2.1.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.1...2.1.1) - 2023-01-27
### Fixed
- add missing class import
## [2.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/2.0...2.1) - 2023-01-27
### Added
- block section for add_to_basket js
- template block order positions
## [2.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.1...2.0) - 2023-01-20
### Added
- using of ContainerFactory in ViewConfig
## [1.17.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.16.0...1.17.0) - 2024-04-11
### Added
- multilang translations
- GA4 consent-mode default values
### Changed
- metadataID centralized
## [1.16.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.15.1...1.16.0) - 2024-04-11
### Added
- ( Google ) Server-Side tagging usability
## [1.15.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.14.0...1.15.0) - 2024-01-25
### Fixed
- missing Component-ArticleDetails extension, missing ManufacturerListController extension
## [1.14.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.13.0...1.14.0) - 2024-01-03
### Added
- add_to_cart Event to several new shop-pages (landing-page, Account, category article-list, start)
- PHPStan code-cleanup
### Changed
- template structure
- code cleanup
## [1.13.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.12.0...1.13.0) - 2023-09-13
### Added
- extended Docs
### Changed
- control-param name
- control-param function
- adjusted check for set control-param
- consentmanager-script-adjustments
## [1.12.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.11.1...1.12.0) - 2023-09-07
### Added
- cookiebot functionality
## [1.11.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.11.0...1.11.1) - 2023-08-17
### Fixed
- metadata class entry
## [1.11.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.10.0...1.11.0) - 2023-08-16
### Added
- remove_from_cart
- auto debug_mode setter
- manufacturer extension for breadcrumb
### Changed
- general template cleanup
## [1.10.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.9.0...1.10.0) - 2023-06-27
### Added
- Following Entries to dedicated event-templates
- coupon
- paymentType
- item_list_name
- item_category
- Method to get the in order used Payment-Name
- Method to get the current Article Category
### Changed
- cookieManager handling
- general template cleanup
- renaming the template to a more intuitive name
## [1.9.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.8.0...1.9.0) - 2023-06-19
### Changed
- add_to_cart event template-structure
## [1.8.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.7.0...1.8.0) - 2023-05-31
### Fixed
- bug in explicit manager selection
## [1.7.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.6.0...1.7.0) - 2023-05-31
### Added
- extended call to read the technical documentation
### Changed
- block-extension for view_item_list
- way of getting list-articles in view_item_list
## [1.6.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.5.0...1.6.0) - 2023-05-30
### Added
- possibility to choose between consentmanager && usercentrics
- position to block extension
### Changed
- genuine code cleanup
- usercentrics includation script
## [1.5.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.4.0...1.5.0) - 2023-05-23
### Added
- additional settings to explicitly indicate that consentmanager is used
### Fixed
- unnecessary converting of int to str
- missing PriceObject-bug
### Changed
- genuine code cleanup
## [1.4.0](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.3.1...1.4.0) - 2023-05-02
### Added
- "OXID Cookie Management powered by usercentrics" compatibility
- usercentrics defined script attributes
- cookie-manager evaluation
### Changed
- genuine clean up of base-js-files
## [1.3.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.2.1...1.3.1) - 2023-03-17
### Added
- Aggrosoft-Cookie-Consent compatibility
### Fixed
- wrong function for pageview on thankyou page
## [1.2.1](https://git.d3data.de/D3Public/GoogleAnalytics4/compare/1.2...1.2.1) - 2023-02-22
### Fixed
- price formatting in view_cart

View File

@ -0,0 +1,18 @@
# Consentmanager
## 1. Steuerungsparameter
Tragen Sie hier die gewĂĽnschte ID des zu prĂĽfenden Anbieters (Vendor-ID) ein.<br>
Diese ID finden Sie in Ihrem Consentmanager-Dashboard, links, unter "CMP > Anbieter".
Nähere Informationen hierzu suchen Sie bitte auf der offiziellen Webseite von [app.consentmanager](https://help.consentmanager.de/books/cmp/page/4-configuring-vendors-and-cookies).
## 2. Gebräuchliche ID's
- s26 (Google Analytics/ GA/ GA4)
- s905 (Google Tag Manager/ GTM)
## 3. Einrichtung GTM
Die von Ihnen eingetragene ID muss oder ist schlussendlich die ID, auf die im GTM-Umfeld geprĂĽft wird.
Das heiĂźt, dass sich die Eintragung nach GTM, oder umgekehrt, richtet.
### Unterstützung benötigt?
Kein Problem!
Kontaktieren Sie uns gern unter [d3data.de](https://www.d3data.de)

View File

@ -1,38 +1,25 @@
## Technische Doku
### GA4 Events / Customizing
FĂĽr alle implementierten GA4 Events existieren Templates unter `source/modules/d3/googleanalytics4/Application/views/ga4/`, dabei entspricht der Dateiname dem Eventnamen in GA4.
# Technische Doku
## GA4 Events / Customizing
FĂĽr alle implementierten GA4 Events existieren Templates unter `source/modules/d3/googleanalytics4/Application/views/event/`, dabei entspricht der Dateiname dem Eventnamen in GA4.
Die Einbindung dieser Event-Templates erfolgt über TPL-Blöcke unter `source/modules/d3/googleanalytics4/Application/views/blocks/`.
*Hinweis: nicht alle templates sind bereits gefĂĽllt. WĂĽnschen Sie die Implementierung eines unausgefĂĽllten templates?
Kommen Sie auf uns zu unter https://www.d3data.de/
### Blöcke
Für den geregelten Ablauf sind folgende Blöcke nötig:
- Suchergebnisse
- Blockname: search_results
- Datei: page/search/search.tpl
- GA4 Event: view_search_results
- Artikelliste
- Blockname: d3Ga4_view_item_list (muss hinzugefĂĽgt werden)
- Datei: widget/product/list.tpl
- GA4 Event: view_item_list
- Detailseite
- Blockname: details_productmain_title
- Datei: page/details/inc/productmain.tpl
- GA4 Event: view_item
- dem WK hinzufĂĽgen (button)
- Blockname: details_productmain_tobasket
- Datei: page/details/inc/productmain.tpl
- GA4 Event: add_to_cart
- Warenkorb
- Blockname: checkout_basket_main
- Datei: page/checkout/basket.tpl
- GA4 Event: view_cart
- abgeschlossener Kauf
- Blockname: checkout_thankyou_main
- Datei: page/checkout/thankyou.tpl
- GA4 Event: purchase
## Container-ID
Diese finden Sie im "Google-Tag-Manager"-Arbeitsbereich in der Navigationsleiste.
Sie beginnt mit GTM, gefolgt von einem Bindestrich und einer Zeichenkette.
### VerfĂĽgbare Datalayer Variablen
Diese ID wird benötigt, um Google anzuweise, zu welchem "Google Tag Manager"-Arbeitsbereich die
gesammelten Daten im Daten-Stream geleitet werden sollen.
## Steuerungsparameter
Tragen Sie hier im Normalfall die ID des zu prĂĽfenden Cookies ein.
In bestimmten Fällen, müssen Sie hier alternative Werte eintragen. Diese Fälle sind bedingt
nach der gewählten CMP (Consent Manager Platform).
> nähere Infos unter [CMP](#consent-manager-platform-cmp)
## VerfĂĽgbare Datalayer Variablen
FĂĽr die einfachste Ăśbersicht der enthaltenen Daten empfehle ich den Vorschau-Modus vom Google Tag Manager.
Bei jedem Seitenaufruf wird die Datenschicht mit einigen wenigen Infos erstellt, die man zum reinen Erfassen der Seitenaufrufe benötigt:
@ -44,8 +31,42 @@ Bei jedem Seitenaufruf wird die Datenschicht mit einigen wenigen Infos erstellt,
Alle fĂĽr Ecommerce Tracking relevanten Daten werden mit speziellen Ecommerce Events in die Datenschicht eingefĂĽgt.
### Cookie-Handling
## Cookie-Handling
Sie nutzen einen eigenen, als Modul im Shop installierten, Cookie-manager?
Dann tragen Sie in den Folgeeinstellungen unter "Cookie Manager Einstellungen",
die Cookie-ID des zugehörigen Cookies ein. Und aktivieren Sie diese Weiche,
indem Sie den Haken bei "Eigenen Cookie Manager nutzen?" setzen.
die Cookie-ID des zugehörigen Cookies ein.
Aktivieren Sie anschlieĂźend diese Weiche. Setzen Sie den Haken bei "Eigenen Cookie Manager nutzen?".
## Consent Manager Platform (CMP)
- [Consentmanager](https://git.d3data.de/D3Public/GoogleAnalytics4/src/branch/master/Docs/CMP/consentmanager.md)
### UnterstĂĽtzung fĂĽr
- [aggrosoft - oxid-cookie-compliance](https://github.com/aggrosoft/oxid-cookie-compliance)
- https://github.com/aggrosoft/oxid-cookie-compliance
- die entsprechend gewählte Kategorie in den Moduleinstellungen des 'Google Analytics 4' unter
```Einstell. > Cookie Manager Einstellungen > Cookie-ID``` eintragen
- Default-Werte sind entweder ```ANALYTICS``` oder ```MARKETING```. Bitte auf die GroĂźschreibung achten.
- [Netensio - Cookie Consent Manager](https://www.netensio.de/oxid-eshop-module/cookie-consent-manager-fuer-oxid-eshop.html)
- Modul entsprechend konfigurieren
- CookieID des angelegten Cookies in den Moduleinstellungen des 'Google Analytics 4' unter
```Einstell. > Cookie Manager Einstellungen > Cookie-ID``` eintragen
- [OXID Cookie Management powered by usercentrics](https://docs.oxid-esales.com/modules/usercentrics/de/latest/einfuehrung.html)
- In der Usercentrics-Verwaltung die Services "Google Analytics" und "Google Tag Manager" anlegen
- Den Service ```Google Tag Manager``` in den Moduleinstellungen des 'Google Analytics 4' unter
Google Tag Manager eintragen
- [Consent Management Provider](https://www.consentmanager.net/)
- In der Consentmanager-Oberfläche den Anbieter "Google Tag Manager" mit der ID s905 hinzufügen
- Im Frontend, im consentmanager-Pop-up nach dem 'Google Tag Manager' suchen
- kleines Fragezeichen neben den Namen anklicken und ganz runter scrollen
- prĂĽfen, ob ein Cookie vorgegeben ist
- sonst, in der Consentmanager-Oberfläche Cookie-Liste entsprechendes Cookie suchen und im Admin unter
```Einstell. > Cookie Manager Einstellungen > Cookie-ID``` eintragen
- [Cookiefirst](https://cookiefirst.com)
- im Cookiefirst-Hub das jeweilige Cookie finden underen zugeordnete Kategorie kopieren
- die kopierte Kategory wird nun in den Einstellungen des Moduls hinterlegt:
```Erweiterungen > Module > Google Analytics 4 > Einstell. > Cookie Manager Einstellungen > Steuerungsparameter (vormals CookieID)```
- **Wichtig!** bei Nutzung des Consent-Managers von Google, muss zwangsläufig die Einstellung "Cookie manager Nutzen?" __ausgeschalten!__ werden

View File

@ -14,5 +14,94 @@
*/
namespace D3\GoogleAnalytics4\Modules\Core{
class ViewConfig_parent extends \OxidEsales\Eshop\Core\ViewConfig{}
}
class ViewConfig_parent extends \OxidEsales\Eshop\Core\ViewConfig
{
}
}
namespace D3\GoogleAnalytics4\Modules\Application\Model{
use OxidEsales\Eshop\Application\Model\Payment;
class Category_parent extends \OxidEsales\Eshop\Application\Model\Category
{
}
class Basket_parent extends \OxidEsales\Eshop\Application\Model\Basket
{
}
class Manufacturer_parent extends \OxidEsales\Eshop\Application\Model\Manufacturer
{
}
class gtmPayment_parent extends Payment
{
}
}
namespace D3\GoogleAnalytics4\Modules\Application\Controller{
use OxidEsales\Eshop\Application\Controller\AccountNoticeListController;
use OxidEsales\Eshop\Application\Controller\AccountRecommlistController;
use OxidEsales\Eshop\Application\Controller\AccountWishlistController;
use OxidEsales\Eshop\Application\Controller\Admin\ManufacturerController;
use OxidEsales\Eshop\Application\Controller\ArticleListController;
use OxidEsales\Eshop\Application\Controller\SearchController;
use OxidEsales\Eshop\Application\Controller\StartController;
class BasketController_parent extends \OxidEsales\Eshop\Application\Controller\BasketController
{
}
class ThankYouController_parent extends \OxidEsales\Eshop\Application\Controller\ThankYouController
{
}
class ArticleListController_AddToCartHelpMethods_parent extends ArticleListController
{
}
class ArticleDetailsController_parent extends \OxidEsales\Eshop\Application\Controller\ArticleDetailsController
{
}
class d3GtmAccountNoticeListController_parent extends AccountNoticeListController
{
}
class d3GtmAccountRecommlistController_parent extends AccountRecommlistController
{
}
class d3GtmAccountWishlistController_parent extends AccountWishlistController
{
}
class d3GtmStartController_parent extends StartController
{
}
class d3GtmSearchController_parent extends SearchController
{
}
class d3GtmManufacturerListController_parent extends ManufacturerController
{
}
}
namespace D3\GoogleAnalytics4\Modules\Application\Component{
use OxidEsales\Eshop\Application\Component\BasketComponent;
class d3GtmBasketComponentExtension_parent extends BasketComponent
{
}
}
namespace D3\GoogleAnalytics4\Modules\Application\Component\Widget{
use OxidEsales\Eshop\Application\Component\Widget\ArticleDetails;
class d3GtmWidgetArticleDetails_parent extends ArticleDetails
{
}
}

View File

@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace D3\GoogleAnalytics4\Modules\Application\Component\Widget;
class d3GtmWidgetArticleDetails extends d3GtmWidgetArticleDetails_parent
{
public function render()
{
$return = parent::render();
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
return $return;
}
}

View File

@ -0,0 +1,77 @@
<?php
namespace D3\GoogleAnalytics4\Modules\Application\Component;
use OxidEsales\Eshop\Application\Model\Article;
use OxidEsales\Eshop\Core\Registry;
class d3GtmBasketComponentExtension extends d3GtmBasketComponentExtension_parent
{
/**
* @param $sProductId
* @param $dAmount
* @param $aSel
* @param $aPersParam
* @param $blOverride
* @return mixed|string
* @throws \Exception
*/
public function toBasket($sProductId = null, $dAmount = null, $aSel = null, $aPersParam = null, $blOverride = false)
{
$return = parent::toBasket($sProductId, $dAmount, $aSel, $aPersParam, $blOverride);
Registry::getSession()->setVariable('d3GtmAddToBasketTrigger', true);
$iAmountArticlesAddedToCart = (int) Registry::getRequest()->getRequestEscapedParameter('am');
if ($iAmountArticlesAddedToCart) {
Registry::getSession()->setVariable('d3GtmAddToCartAmountArticles', $iAmountArticlesAddedToCart);
} else {
Registry::getSession()->setVariable('d3GtmAddToCartAmountArticles', 1);
}
return $return;
}
/**
* @return int
*/
public function getD3GtmAddToCartAmountArticles(): int
{
$iAmount = Registry::getSession()->getVariable('d3GtmAddToCartAmountArticles');
Registry::getSession()->deleteVariable('d3GtmAddToCartAmountArticles');
return (int) $iAmount;
}
/**
* @return bool
*/
public function getAddToBasketDecision(): bool
{
$decision = Registry::getSession()->getVariable('d3GtmAddToBasketTrigger');
Registry::getSession()->setVariable('d3GtmAddToBasketTrigger', false);
return (bool) $decision;
}
/**
* @return Article|null
*/
public function d3GtmRequestedArticleLoadedByAnid()
{
$sAnid = Registry::getRequest()->getRequestEscapedParameter('anid');
$oArticle = null;
if ($sAnid) {
/** @var Article $oArticle */
$oArticle = oxNew(Article::class);
$oArticle->load($sAnid);
}
return $oArticle;
}
}

View File

@ -0,0 +1,15 @@
<?php
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
class ArticleDetailsController extends ArticleDetailsController_parent
{
public function render()
{
$return = parent::render();
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
return $return;
}
}

View File

@ -0,0 +1,15 @@
<?php
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
class ArticleListController_AddToCartHelpMethods extends ArticleListController_AddToCartHelpMethods_parent
{
public function render()
{
$render = parent::render();
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
return $render;
}
}

View File

@ -0,0 +1,123 @@
<?php
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
use OxidEsales\Eshop\Application\Component\BasketComponent;
use OxidEsales\Eshop\Application\Model\Article;
use OxidEsales\Eshop\Application\Model\ArticleList;
use OxidEsales\Eshop\Core\Registry;
use oxSystemComponentException;
class BasketController extends BasketController_parent
{
/**
* @return string
*/
public function render()
{
$return = parent::render();
$this->d3GA4getRemovedArticlesListObject();
return $return;
}
/**
* @return void
* @throws oxSystemComponentException
*/
public function d3GA4getRemovedArticlesListObject(): void
{
$this->addTplParam('hasBeenReloaded', false);
// collecting items to add
$aProducts = Registry::getRequest()->getRequestEscapedParameter('aproducts');
// collecting specified item
$sProductId = Registry::getRequest()->getRequestEscapedParameter('aid');
if ($sProductId) {
// additionally fetching current product info
$dAmount = Registry::getRequest()->getRequestEscapedParameter('am');
// select lists
$aSel = Registry::getRequest()->getRequestEscapedParameter('sel');
/** @var BasketComponent $oBasketComponent */
$oBasketComponent = $this->getComponent('oxcmp_basket');
$aPersParam = $oBasketComponent->__call('getPersistedParameters', []);
$sBasketItemId = Registry::getRequest()->getRequestEscapedParameter('bindex');
$aProducts[$sProductId] = [
'am' => $dAmount,
'sel' => $aSel,
'persparam' => $aPersParam,
'basketitemid' => $sBasketItemId,
];
}
if (is_array($aProducts) && count($aProducts)) {
$toRemoveArticleIdList = [];
$artIdOnArtAmountList = [];
if ($this->isArticleRemovedState($aProducts)) {
//setting amount to 0 if removing article from basket
foreach ($aProducts as $sProductId => $aProduct) {
if ((isset($aProduct['remove']) && $aProduct['remove']) or intval($aProduct['am']) === 0) {
if (!in_array($aProduct, $toRemoveArticleIdList)) {
$toRemoveArticleIdList[] = $aProduct['aid'];
$artIdOnArtAmountList[$aProduct['aid']] = $aProduct['am'];
}
$aProducts[$sProductId]['am'] = 0;
#for GA4 Event
$this->addTplParam('hasBeenReloaded', true);
} else {
unset($aProducts[$sProductId]);
}
}
}
$oArtList = oxNew(ArticleList::class);
$oArtList->loadIds($toRemoveArticleIdList);
#dumpVar($this->getBasketArticles());
/** @var Article $item */
foreach ($oArtList->getArray() as $item) {
foreach ($artIdOnArtAmountList as $artId => $artAmount) {
if ($item->getId() === $artId) {
$item->assign(['d3AmountThatGotRemoved' => $artAmount]);
}
}
}
$this->addTplParam('toRemoveArticles', $oArtList);
}
}
/**
* @return bool
*
* checks, if we're in the short state of "an Article has been removed"
* We check by looking for the "'removeBtn' is not null", as a sign for it has been triggered/ clicked
* if that doesn't work, we check if there's an Article in the Products array, that has "'am' = 0"
* Which also shows we're in that state rn
*/
protected function isArticleRemovedState(array $productsArray): bool
{
if (Registry::getRequest()->getRequestEscapedParameter('removeBtn')
or Registry::getRequest()->getRequestEscapedParameter('updateBtn')
) {
return true;
} else {
foreach ($productsArray as $aProduct) {
if (intval($aProduct['am']) === 0) {
return true;
}
}
}
return false;
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
use OxidEsales\Eshop\Application\Model\Country;
use OxidEsales\Eshop\Application\Model\Order;
class ThankYouController extends ThankYouController_parent
{
/**
* @return Country
*/
public function d3GAGetUserCountry()
{
/** @var Order $oOrder */
$oOrder = $this->getOrder();
$sCountryId = $oOrder->getFieldData('oxbillcountryid');
/** @var Country::class $oCountry */
$oCountry = oxNew(Country::class);
$oCountry->load($sCountryId);
return $oCountry;
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
use D3\GoogleAnalytics4\Application\Model\Constants;
class d3GtmAccountNoticeListController extends d3GtmAccountNoticeListController_parent
{
protected $_sThisTemplate = '@' . Constants::OXID_MODULE_ID . '/page/account/d3gtmnoticelist.tpl';
public function render()
{
$return = parent::render();
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
return $return;
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
use D3\GoogleAnalytics4\Application\Model\Constants;
class d3GtmAccountRecommlistController extends d3GtmAccountRecommlistController_parent
{
protected $_sThisTemplate = '@' . Constants::OXID_MODULE_ID . '/page/account/d3gtmrecommendationlist.tpl';
public function render()
{
$return = parent::render();
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
return $return;
}
}

View File

@ -0,0 +1,19 @@
<?php
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
use D3\GoogleAnalytics4\Application\Model\Constants;
class d3GtmAccountWishlistController extends d3GtmAccountWishlistController_parent
{
protected $_sThisTemplate = '@' . Constants::OXID_MODULE_ID . '/page/account/d3gtmwishlist.tpl';
public function render()
{
$return = parent::render();
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
return $return;
}
}

View File

@ -0,0 +1,17 @@
<?php
declare(strict_types=1);
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
class d3GtmManufacturerListController extends d3GtmManufacturerListController_parent
{
public function render()
{
$return = parent::render();
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
return $return;
}
}

View File

@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
class d3GtmSearchController extends d3GtmSearchController_parent
{
/**
* @return string
*/
public function render()
{
$return = parent::render();
if (false === in_array('oxcmp_basket', $this->getComponents())) {
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
}
return $return;
}
}

View File

@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace D3\GoogleAnalytics4\Modules\Application\Controller;
class d3GtmStartController extends d3GtmStartController_parent
{
public function render()
{
$return = parent::render();
if (false === in_array('oxcmp_basket', $this->getComponents())) {
$this->addTplParam('d3CmpBasket', $this->getComponent('oxcmp_basket'));
}
return $return;
}
}

View File

@ -0,0 +1,23 @@
<?php
namespace D3\GoogleAnalytics4\Modules\Application\Model;
use OxidEsales\Eshop\Application\Model\Payment;
class Basket extends Basket_parent
{
/**
* @return string
*/
public function getPaymentOnPaymentId(): string
{
if ($this->getPaymentId()) {
$oPayment = oxNew(Payment::class);
if ($oPayment->load($this->getPaymentId())) {
return $oPayment->getFieldData('oxdesc');
}
}
return "couldn't load payment!";
}
}

View File

@ -0,0 +1,8 @@
<?php
namespace D3\GoogleAnalytics4\Modules\Application\Model;
class Category extends Category_parent
{
use articleTreeStructure;
}

View File

@ -0,0 +1,8 @@
<?php
namespace D3\GoogleAnalytics4\Modules\Application\Model;
class Manufacturer extends Manufacturer_parent
{
use articleTreeStructure;
}

View File

@ -0,0 +1,10 @@
<?php
declare(strict_types=1);
namespace D3\GoogleAnalytics4\Modules\Application\Model;
class Vendor extends \OxidEsales\Eshop\Application\Model\Vendor
{
use articleTreeStructure;
}

View File

@ -0,0 +1,44 @@
<?php
namespace D3\GoogleAnalytics4\Modules\Application\Model;
trait articleTreeStructure
{
/**
* @param int $indexOfArray
* @return string
*/
public function getSplitCategoryArray(int $indexOfArray = -1, bool $bShallTakeStd = false): string
{
if ($bShallTakeStd) {
$splitCatArray =
array_values(
array_filter(
explode(
'/',
trim(
parse_url(
$this->getLink(),
5
)
)
)
)
);
if (($indexOfArray >= 0) and (false === empty($splitCatArray[$indexOfArray]))) {
return $splitCatArray[$indexOfArray];
} else {
return "";
}
}
return
trim(
parse_url(
$this->getLink(),
5
)
);
}
}

View File

@ -0,0 +1,19 @@
<?php
declare(strict_types=1);
namespace D3\GoogleAnalytics4\Modules\Application\Model;
use OxidEsales\Eshop\Application\Model\Payment;
use OxidEsales\Eshop\Core\Registry;
class gtmPayment extends gtmPayment_parent
{
/**
* @return string
*/
public function gtmGetSelectedPaymentName(): string
{
return $this->getFieldData('oxpayments__oxdesc') ?: 'No payment name available';
}
}

View File

@ -1,76 +1,186 @@
<?php
/**
* This Software is the property of Data Development and is protected
* by copyright law - it is NOT Freeware.
* Any unauthorized use of this software without a valid license
* is a violation of the license agreement and will be prosecuted by
* civil and criminal law.
* http://www.shopmodule.com
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* https://www.d3data.de
*
* @copyright (C) D3 Data Development (Inh. Thomas Dartsch)
* @author D3 Data Development - Daniel Seifert <support@shopmodule.com>
* @link http://www.oxidmodule.com
* @author D3 Data Development - Daniel Seifert <info@shopmodule.com>
* @link https://www.oxidmodule.com
*/
namespace D3\GoogleAnalytics4\Modules\Core;
use D3\GoogleAnalytics4\Application\Model\CMP\Usercentrics;
use D3\GoogleAnalytics4\Application\Model\Constants;
use D3\GoogleAnalytics4\Application\Model\ManagerHandler;
use D3\GoogleAnalytics4\Application\Model\ManagerTypes;
use OxidEsales\Eshop\Application\Controller\FrontendController;
use OxidEsales\Eshop\Core\Config;
use OxidEsales\Eshop\Application\Model\User;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\EshopCommunity\Internal\Container\ContainerFactory;
use OxidEsales\EshopCommunity\Internal\Framework\Module\Configuration\Exception\ModuleConfigurationNotFoundException;
use OxidEsales\EshopCommunity\Internal\Framework\Module\Setup\Bridge\ModuleActivationBridgeInterface;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
class ViewConfig extends ViewConfig_parent
{
// Google Tag Manager Container ID
private $sContainerId = null;
// used CMP
private $sCookieManagerType = null;#
// isModule Activated properly?
private $blGA4enabled = null;
public function getGtmContainerId()
{
if ($this->sContainerId === null)
{
$this->sContainerId = $this->getConfig()->getConfigParam('d3_gtm_sContainerID');
if ($this->sContainerId === null) {
$this->sContainerId = $this->d3GetModuleConfigParam("_sContainerID");
}
return $this->sContainerId;
}
/**
* @param $sCookieID
* @return void
*/
public function defineCookieManagerType(): void
{
if ($this->sCookieManagerType === null) {
/** @var ManagerHandler $oManagerHandler */
$oManagerHandler = oxNew(ManagerHandler::class);
$this->sCookieManagerType = $oManagerHandler->getActManager();
}
}
/**
* @return bool
*/
public function D3blAcceptedCookie($sCookieID)
public function shallUseOwnCookieManager(): bool
{
$oSession = Registry::getSession();
$aCookies = $oSession->getVariable("aCookieSel");
return (bool) $this->d3GetModuleConfigParam('_blEnableOwnCookieManager');
}
if (!is_null($aCookies) && is_array($aCookies) && array_key_exists($sCookieID, $aCookies) && $aCookies[$sCookieID] == "1") {
/**
* @return bool
*/
public function D3blShowGtmScript()
{
/** @var Config $oConfig */
$oConfig = Registry::getConfig();
if (false === $this->isGA4enabled()) {
return false;
}
// No Cookie Manager in use
if (false === $this->shallUseOwnCookieManager()) {
return true;
}
$this->defineCookieManagerType();
$sCookieID = trim($this->d3GetModuleConfigParam('_sControlParameter'));
// Netensio Cookie Manager
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_NET_COOKIE_MANAGER) {
$oSession = Registry::getSession();
$aCookies = $oSession->getVariable("aCookieSel");
return (is_array($aCookies) && array_key_exists($sCookieID, $aCookies) && $aCookies[$sCookieID] == "1");
}
// Aggrosoft Cookie Consent
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_AGCOOKIECOMPLIANCE) {
if (method_exists($this, "isCookieCategoryEnabled")) {
return $this->isCookieCategoryEnabled($sCookieID);
}
}
if (
in_array(
$this->sCookieManagerType,
(oxNew(ManagerTypes::class)->scriptTagDeliveredByDefaultArray())
)
) {
// Always needs the script-tags delivered to the DOM.
return true;
}
// Cookie Manager not (yet) supported
return false;
}
private $blGA4enabled = null;
/**
* Get additional attributes for script tags.
* This is especially important for UserCentrics.
* @return string
*/
public function getGtmScriptAttributes(): string
{
$sControlParameter = trim($this->d3GetModuleConfigParam('_sControlParameter'));
if (false === $this->shallUseOwnCookieManager() or ($sControlParameter === '')) {
return "";
}
if (
$this->sCookieManagerType === Usercentrics::sModuleIncludationInternalName
or $this->sCookieManagerType === Usercentrics::sExternalIncludationInternalName
) {
return 'data-usercentrics="' . $sControlParameter . '" type="text/plain" async=""';
}
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_CONSENTMANAGER) {
return 'type="text/plain" class="cmplazyload" data-cmp-vendor="'.$sControlParameter.'"';
}
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_COOKIEFIRST) {
return 'type="text/plain" data-cookiefirst-category="' . $sControlParameter .'"';
}
if ($this->sCookieManagerType === ManagerTypes::INTERNAL_COOKIEBOT) {
return 'type="text/plain" data-cookieconsent="' . $sControlParameter .'"';
}
return "";
}
/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function isGA4enabled()
{
if ($this->blGA4enabled === null)
{
$this->sContainerId = $this->getConfig()->getConfigParam('d3_gtm_blEnableGA4');
if ($this->blGA4enabled === null) {
$this->blGA4enabled = $this->d3GetModuleConfigParam("_blEnableGA4");
}
return $this->blGA4enabled;
}
public function isGtmConsentModeSetActivated(): bool
{
return $this->d3GetModuleConfigParam("_blEnableConsentMode") ?: false;
}
public function getGtmDataLayer()
{
if (!$this->getGtmContainerId()) return "[]";
if (!$this->getGtmContainerId()) {
return "[]";
}
$oConfig = Registry::getConfig();
$oView = $oConfig->getTopActiveView();
/** @var FrontendController $oShop */
/** @var User|false|null $oUser */
$oUser = $oConfig->getUser();
$cl = $this->getTopActionClassName();
$cl = $this->getTopActiveClassName();
$aPageTypes = [
"content" => "cms",
"details" => "product",
@ -81,6 +191,7 @@ class ViewConfig extends ViewConfig_parent
"payment" => "checkout",
"order" => "checkout",
"thankyou" => "checkout",
"start" => "start",
];
$dataLayer = [
@ -89,17 +200,79 @@ class ViewConfig extends ViewConfig_parent
'title' => $oView->getTitle(),
'cl' => $cl,
],
'userid' => ($oUser ? $oUser->getId() : false),
'sessionid' => session_id() ?? false,
'userid' => $oUser instanceof User ? $oUser->getId() : false,
'sessionid' => session_id(),
//'httpref' => $_SERVER["HTTP_REFERER"] ?? "unknown"
];
return json_encode([$dataLayer], JSON_PRETTY_PRINT);
}
public function isPromotionList($listId)
public function isDebugModeOn(): bool
{
$oConfig = Registry::getConfig();
$aPromotionListIds = $oConfig->getConfigParam("") ?? ['bargainItems', 'newItems', 'topBox', 'alsoBought', 'accessories', 'cross'];
return $this->d3GetModuleConfigParam("_blEnableDebug") ?: false;
}
}
/**
* @return string
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function getServerSidetaggingJsDomain(): string
{
return $this->d3GetModuleConfigParam("_sServersidetagging_js") ?: "";
}
/**
* @return string
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function getServerSidetaggingNoJsDomain(): string
{
return $this->d3GetModuleConfigParam('_sServersidetagging_nojs') ?: "";
}
/**
* @param string $configParamName
* @return mixed
*/
public function d3GetModuleConfigParam(string $configParamName)
{
return Registry::getConfig()->getShopConfVar(Constants::OXID_MODULE_ID.$configParamName, null, Constants::OXID_MODULE_ID);
}
/**
* @return bool
*/
public function d3IsUsercentricsCMPChosen(): bool
{
$sCMPPubName = $this->d3GetModuleConfigParam('_HAS_STD_MANAGER');
$aPossibleCMP = (oxNew(ManagerTypes::class))->getManagerList();
return (bool) ($sCMPPubName === Usercentrics::sExternalIncludationInternalName
or $sCMPPubName === Usercentrics::sModuleIncludationInternalName);
}
/**
* @return bool
*/
public function d3IsModuleActive(string $sModuleId): bool
{
/** @var ModuleActivationBridgeInterface $moduleActivationBridge */
$moduleActivationBridge = $this
->getContainer()
->get(ModuleActivationBridgeInterface::class);
try {
$isActiveBool = $moduleActivationBridge->isActive(
$sModuleId,
Registry::getConfig()->getShopId()
);
} catch (\Exception|ModuleConfigurationNotFoundException $e) {
return false;
}
return (bool) $isActiveBool;
}
}

View File

@ -0,0 +1,42 @@
<?php
namespace D3\GoogleAnalytics4\Modules\Core;
use OxidEsales\EshopCommunity\Core\Registry;
class WidgetControl extends WidgetControl_parent
{
protected function getFrontendStartControllerKey() // phpcs:ignore PSR2.Methods.MethodDeclaration.Underscore
{
/*
* array (
'force_sid' => '2pistlaubiq58qtg3moudei0la',
'lang' => '0',
'actcontrol' => 'details',
'anid' => '064471',
'cl' => 'oxwarticledetails',
'cnid' => '159dd0f2fb2bd6e24ace53a0f1913797',
'listtype' => 'list',
'nocookie' => '1',
'oxwparent' => 'details',
'sid' => '2pistlaubiq58qtg3moudei0la',
'stoken' => 'A22D0F9E',
'varselid' =>
array (
0 => 'b842982bf522aa839bd88221f562fce8',
),
)
*/
$sScriptName = $_SERVER['SCRIPT_NAME'];
if ($sScriptName !== '/widget.php') {
return parent::getFrontendStartControllerKey();
}
$aParameter = $_GET;
if (is_null($aParameter['actcontrol']) and is_null($aParameter['oxwparent'])) {
return 'D3\GoogleAnalytics4\Application\Component\Widget\d3GtmStartWidget';
}
return parent::getFrontendStartControllerKey();
}
}

View File

@ -23,13 +23,27 @@ Dieses Paket erfordert einen mit Composer installierten OXID eShop in einer in d
Ă–ffnen Sie eine Kommandozeile und navigieren Sie zum Stammverzeichnis des Shops (Elternverzeichnis von source und vendor). FĂĽhren Sie den folgenden Befehl aus. Passen Sie die Pfadangaben an Ihre Installationsumgebung an.
```bash
php composer require d3/google-analytics4:^1
php composer require d3/google-analytics4:^3
```
Sofern nötig, bestätigen Sie bitte, dass Sie `package-name` erlauben, Code auszuführen.
```bash
./vendor/bin/oe-console oe:module:deactivate d3googleanalytics4
./vendor/bin/oe-console oe:module:install ./vendor/d3/google-analytics4/
./vendor/bin/oe-console oe:module:activate d3googleanalytics4
./vendor/bin/oe-eshop-db_views_generate
```
Leeren Sie anschlieĂźend den Temp Ordner des Shops.
Aktivieren Sie das Modul im Shopadmin unter "Erweiterungen -> Module".
### Wichtig!
Bitte stellen Sie sicher, dass die nötigen Template-Blöcke im OXID-Shop zur Verfügung stehen.
Lesen Sie mehr in der [technischen Doku](./Docs/README.md) unter "Blöcke"!
## Verwendung
### Grundfunktionalität
Nach erfolgreicher Installation finden Sie in Ihrem Shop-Admin unter "Erweiterungen > Module"
@ -77,5 +91,6 @@ Die vollständigen Copyright- und Lizenzinformationen entnehmen Sie bitte der [L
Zu diesem Modul haben beigetragen:
- [Marat Bedoev](https://github.com/vanilla-thunder)
- [Christoph Stäblein [gn2]](https://github.com/reyneke-vosz)
Vielen Dank.

44
Setup/Actions.php Normal file
View File

@ -0,0 +1,44 @@
<?php
declare(strict_types=1);
namespace D3\GoogleAnalytics4\Setup;
use D3\GoogleAnalytics4\Application\Model\Constants;
use OxidEsales\Eshop\Core\Registry;
use OxidEsales\Eshop\Core\ViewConfig;
class Actions
{
/**
* @param string $sVarType
* @param string $sSettingName
* @param string $sSettingValue
* @return void
*/
public function d3SaveDefaultSettings(string $sVarType, string $sSettingName, string $sSettingValue)
{
$oConfig = Registry::getConfig();
if ($this->d3GetModuleConfigParam($sSettingName) and (trim($this->d3GetModuleConfigParam($sSettingName)) !== trim($sSettingValue))) {
$sSettingValue = trim($this->d3GetModuleConfigParam($sSettingName));
}
$oConfig->saveShopConfVar(
$sVarType,
Constants::OXID_MODULE_ID.$sSettingName,
$sSettingValue,
$oConfig->getShopId(),
Constants::OXID_MODULE_ID
);
}
/**
* @param string $configParamName
* @return mixed
*/
public function d3GetModuleConfigParam(string $configParamName)
{
return Registry::getConfig()->getShopConfVar(Constants::OXID_MODULE_ID.$configParamName, null, Constants::OXID_MODULE_ID);
}
}

38
Setup/Events.php Normal file
View File

@ -0,0 +1,38 @@
<?php
declare(strict_types=1);
namespace D3\GoogleAnalytics4\Setup;
class Events
{
/**
* @return void
*/
public static function onActivate()
{
$oActions = oxNew(Actions::class);
$oActions->d3SaveDefaultSettings(
'str',
'_sServersidetagging_js',
'https://www.googletagmanager.com/gtm.js'
);
$oActions->d3SaveDefaultSettings(
'str',
'_sServersidetagging_nojs',
'https://www.googletagmanager.com/ns.html'
);
$oActions->d3SaveDefaultSettings(
'str',
'_sContainerID',
'GTM-'
);
}
/**
* @return void
*/
public static function onDeactivate()
{
}
}

0
thumbnail.png → assets/thumbnail.png Executable file → Normal file
View File

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -1,56 +1,52 @@
{
"name": "d3/google-analytics4",
"description": "Google Tag Manager with new Google Analytics 4 for OXID eShop v6",
"type": "oxideshop-module",
"keywords": [
"oxid",
"modules",
"eShop",
"d3",
"google",
"ga4",
"googleanalytics",
"gtm",
"configuration"
],
"homepage": "https://www.d3data.de",
"license": [
"GPL-3.0"
],
"authors": [
{
"name": "Marat Bedoev",
"email": "hello@mb-dev.pro"
},
{
"name": "D3 Data Development (Inh. Thomas Dartsch)",
"email": "info@shopmodule.com",
"homepage": "https://www.d3data.de"
}
],
"support": {
"email": "support@shopmodule.com"
},
"extra": {
"oxideshop": {
"blacklist-filter": [
"*.md",
"composer.json",
".php-cs-fixer.php",
"*.xml",
"*.neon"
],
"target-directory": "d3/googleanalytics4"
}
},
"require": {
"php": ">=7.1",
"oxid-esales/oxideshop-ce": "v6.0 - 6.3",
"google/apiclient":" ^2.0"
},
"autoload": {
"psr-4": {
"D3\\GoogleAnalytics4\\": "../../../source/modules/d3/googleanalytics4"
}
}
{
"name": "d3/google-analytics4",
"description": "Google Tag Manager with new Google Analytics 4 for OXID eShop v6",
"type": "oxideshop-module",
"keywords": [
"oxid",
"modules",
"eShop",
"d3",
"google",
"ga4",
"googleanalytics",
"gtm",
"configuration"
],
"homepage": "https://www.d3data.de",
"license": [
"GPL-3.0"
],
"authors": [
{
"name": "Marat Bedoev",
"email": "hello@mb-dev.pro"
},
{
"name": "D3 Data Development (Inh. Thomas Dartsch)",
"email": "info@shopmodule.com",
"homepage": "https://www.d3data.de"
}
],
"supports": {
"email": "support@shopmodule.com"
},
"require": {
"php": "^8.0",
"oxid-esales/oxideshop-ce": "7.0 - 7.2",
"google/apiclient":" ^2.0",
"phpstan/phpstan": "^1.10"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.9"
},
"autoload": {
"psr-4": {
"D3\\GoogleAnalytics4\\": ""
}
},
"scripts": {
"php-cs-fixer_audit": "./vendor/bin/php-cs-fixer list-files --config=./vendor/d3/google-analytics4/.php-cs-fixer.php",
"php-cs-fixer_fix": "./vendor/bin/php-cs-fixer fix --config=./vendor/d3/google-analytics4/.php-cs-fixer.php"
}
}

8
menu.xml Normal file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="ISO-8859-15"?>
<OX>
<OXMENU id="d3mxd3modules">
<MAINMENU id="d3mxgoogleanalytics4">
<SUBMENU id="d3mxgoogleanalytics4set" cl="d3googleanalytics4_main"/>
</MAINMENU>
</OXMENU>
</OX>

View File

@ -1,11 +1,46 @@
<?php
use D3\GoogleAnalytics4\Application\Controller\Admin\GA4AdminUserInterface_main as GA4AdminUserInterfaceMainController;
use D3\GoogleAnalytics4\Application\Model\Constants as Constants;
use D3\GoogleAnalytics4\Modules\Application\Component\d3GtmBasketComponentExtension;
use D3\GoogleAnalytics4\Modules\Application\Component\Widget\d3GtmWidgetArticleDetails as d3GtmWidgetArticleDetails;
use D3\GoogleAnalytics4\Modules\Application\Controller\ArticleDetailsController;
use D3\GoogleAnalytics4\Modules\Application\Controller\ArticleListController_AddToCartHelpMethods;
use D3\GoogleAnalytics4\Modules\Application\Controller\BasketController;
use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmAccountNoticeListController;
use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmAccountRecommlistController;
use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmAccountWishlistController;
use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmManufacturerListController as d3GtmManufacturerListController;
use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmSearchController;
use D3\GoogleAnalytics4\Modules\Application\Controller\d3GtmStartController;
use D3\GoogleAnalytics4\Modules\Application\Controller\ThankYouController;
use D3\GoogleAnalytics4\Modules\Application\Model\Basket as Basket;
use D3\GoogleAnalytics4\Modules\Application\Model\Category as Category;
use D3\GoogleAnalytics4\Modules\Application\Model\gtmPayment as gtmPayment;
use D3\GoogleAnalytics4\Modules\Application\Model\Manufacturer as Manufacturer;
use D3\GoogleAnalytics4\Modules\Core\ViewConfig;
use OxidEsales\Eshop\Application\Component\BasketComponent as OEBasketComponent;
use OxidEsales\Eshop\Application\Component\Widget\ArticleDetails as OEArticleDetails;
use OxidEsales\Eshop\Application\Controller\AccountNoticeListController as OEAccountNoticeListController;
use OxidEsales\Eshop\Application\Controller\AccountRecommlistController as OEAccountRecommlistController;
use OxidEsales\Eshop\Application\Controller\AccountWishlistController as OEAccountWishlistController;
use OxidEsales\Eshop\Application\Controller\ArticleDetailsController as OEArticleDetailsController;
use OxidEsales\Eshop\Application\Controller\ArticleListController as OEArticleListController;
use OxidEsales\Eshop\Application\Controller\BasketController as OEBasketController;
use OxidEsales\Eshop\Application\Controller\ManufacturerListController as OEManufacturerListController;
use OxidEsales\Eshop\Application\Controller\SearchController as OESearchController;
use OxidEsales\Eshop\Application\Controller\StartController as OEStartController;
use OxidEsales\Eshop\Application\Controller\ThankYouController as OEThankYouController;
use OxidEsales\Eshop\Application\Model\Basket as OEBasket;
use OxidEsales\Eshop\Application\Model\Category as OECategory;
use OxidEsales\Eshop\Application\Model\Manufacturer as OEManufacturer;
use OxidEsales\Eshop\Application\Model\Payment as OEPayment;
use OxidEsales\Eshop\Core\ViewConfig as OEViewConfig;
$sMetadataVersion = '2.1';
$aModule = [
'id' => 'd3googleanalytics4',
'title' => 'Google Analytics 4',
$aModule = [
'id' => Constants::OXID_MODULE_ID,
'title' => 'Google Analytics 4',
'description' => "Dieses Modul bietet die Möglichkeit in Ihrem OXID eShop (6.x) die neue 'Property'
Google Analytics 4 (GA4) von Google zu integrieren.<br>
HierfĂĽr stehen Ihnen verschiedene 'templates' zur verfĂĽgung,
@ -16,154 +51,159 @@ $aModule = [
<hr>
Die Entwicklung basiert auf einem Fork von Marat Bedoev - <a href='https://github.com/vanilla-thunder/oxid-module-gtm'>Github-Link</a>
",
'thumbnail' => 'thumbnail.png',
'version' => '1.2.1',
'author' => 'Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/',
'extend' => [
OEViewConfig::class => ViewConfig::class
'thumbnail' => 'thumbnail.png',
'version' => '3.0.0.1',
'author' => 'Data Development (Inh.: Thomas Dartsch)',
'email' => 'support@shopmodule.com',
'url' => 'https://www.oxidmodule.com/',
'controllers' => [
'd3googleanalytics4_main' => GA4AdminUserInterfaceMainController::class,
],
'templates' => [
// GA4 events
'ga4_add_payment_info.tpl' => 'd3/googleanalytics4/Application/views/ga4/add_payment_info.tpl',
'add_shipping_info.tpl' => 'd3/googleanalytics4/Application/views/ga4/add_shipping_info.tpl',
'ga4_add_to_cart.tpl' => 'd3/googleanalytics4/Application/views/ga4/add_to_cart.tpl',
'ga4_begin_checkout.tpl' => 'd3/googleanalytics4/Application/views/ga4/begin_checkout.tpl',
'ga4_generate_lead.tpl' => 'd3/googleanalytics4/Application/views/ga4/generate_lead.tpl',
'ga4_login.tpl' => 'd3/googleanalytics4/Application/views/ga4/login.tpl',
'ga4_purchase.tpl' => 'd3/googleanalytics4/Application/views/ga4/purchase.tpl',
'ga4_remove_from_cart.tpl' => 'd3/googleanalytics4/Application/views/ga4/remove_from_cart.tpl',
'ga4_search.tpl' => 'd3/googleanalytics4/Application/views/ga4/search.tpl',
'ga4_select_content.tpl' => 'd3/googleanalytics4/Application/views/ga4/select_content.tpl',
'ga4_select_item.tpl' => 'd3/googleanalytics4/Application/views/ga4/select_item.tpl',
'ga4_select_promotion.tpl' => 'd3/googleanalytics4/Application/views/ga4/select_promotion.tpl',
'ga4_sign_up.tpl' => 'd3/googleanalytics4/Application/views/ga4/sign_up.tpl',
'ga4_view_cart.tpl' => 'd3/googleanalytics4/Application/views/ga4/view_cart.tpl',
'ga4_view_item.tpl' => 'd3/googleanalytics4/Application/views/ga4/view_item.tpl',
'ga4_view_item_list.tpl' => 'd3/googleanalytics4/Application/views/ga4/view_item_list.tpl',
'ga4_view_promotion.tpl' => 'd3/googleanalytics4/Application/views/ga4/view_promotion.tpl',
'extend' => [
// Core
OEViewConfig::class => ViewConfig::class,
\OxidEsales\Eshop\Core\WidgetControl::class => \D3\GoogleAnalytics4\Modules\Core\WidgetControl::class,
// Model
OECategory::class => Category::class,
OEBasket::class => Basket::class,
OEManufacturer::class => Manufacturer::class,
OEPayment::class => gtmPayment::class,
// Controller
OEBasketController::class => BasketController::class,
OEThankYouController::class => ThankYouController::class,
OEArticleListController::class => ArticleListController_AddToCartHelpMethods::class,
OEArticleDetailsController::class => ArticleDetailsController::class,
OEAccountNoticeListController::class => d3GtmAccountNoticeListController::class,
OEAccountRecommlistController::class => d3GtmAccountRecommlistController::class,
OEAccountWishlistController::class => d3GtmAccountWishlistController::class,
OEStartController::class => d3GtmStartController::class,
OESearchController::class => d3GtmSearchController::class,
OEManufacturerListController::class => d3GtmManufacturerListController::class,
// Component
OEArticleDetails::class => d3GtmWidgetArticleDetails::class,
OEBasketComponent::class => d3GtmBasketComponentExtension::class,
],
'blocks' => [
'templates' => [
// Event files that store the GA4 Event-Information
'@' . Constants::OXID_MODULE_ID . '/event/add_to_cart.tpl' => 'views/smarty/event/add_to_cart.tpl',
'@' . Constants::OXID_MODULE_ID . '/event/view_item.tpl' => 'views/smarty/event/view_item.tpl',
'@' . Constants::OXID_MODULE_ID . '/event/view_cart.tpl' => 'views/smarty/event/view_cart.tpl',
'@' . Constants::OXID_MODULE_ID . '/event/begin_checkout.tpl' => 'views/smarty/event/begin_checkout.tpl',
'@' . Constants::OXID_MODULE_ID . '/event/add_payment_info.tpl' => 'views/smarty/event/add_payment_info.tpl',
'@' . Constants::OXID_MODULE_ID . '/event/purchase.tpl' => 'views/smarty/event/purchase.tpl',
'@' . Constants::OXID_MODULE_ID . '/event/view_item_list.tpl' => 'views/smarty/event/view_item_list.tpl',
'@' . Constants::OXID_MODULE_ID . '/event/view_search_result.tpl' => 'views/smarty/event/view_search_result.tpl',
'@' . Constants::OXID_MODULE_ID . '/event/remove_from_cart.tpl' => 'views/smarty/event/remove_from_cart.tpl',
// complete overwritten file of OXID-Originals
// the path of the template-name is the original path to the file in OXID-context from tpl/->
'@' . Constants::OXID_MODULE_ID . '/page/account/d3gtmnoticelist.tpl' => 'views/smarty/page/account/d3gtmnoticelist.tpl',
'@' . Constants::OXID_MODULE_ID . '/page/account/d3gtmrecommendationlist.tpl' => 'views/smarty/page/account/d3gtmrecommendationlist.tpl',
'@' . Constants::OXID_MODULE_ID . '/page/account/d3gtmwishlist.tpl' => 'views/smarty/page/account/d3gtmwishlist.tpl',
// Admin Templates
'@' . Constants::OXID_MODULE_ID . '/admin/d3ga4uimain.tpl' => 'views/smarty/admin/d3googleanalytics4_main.tpl',
'@' . Constants::OXID_MODULE_ID . '/admin/d3ga4uiheaditem.tpl' => 'views/smarty/admin/d3googleanalytics4_headitem.tpl',
],
'blocks' => [
// tag manager js
[
'template' => 'layout/base.tpl',
'block' => 'head_meta_robots',
'file' => '/Application/views/blocks/_gtm_js.tpl'
'block' => 'head_meta_robots',
'file' => 'views/smarty/blocks/_gtm_js.tpl',
'position' => 150,
],
// tag manager nojs
[
'template' => 'layout/base.tpl',
'block' => 'theme_svg_icons',
'file' => '/Application/views/blocks/_gtm_nojs.tpl'
],
// widget_product_list
[
'template' => 'widget/product/list.tpl',
'block' => 'widget_product_list',
'file' => '/Application/views/blocks/widget_product_list.tpl'
'block' => 'theme_svg_icons',
'file' => 'views/smarty/blocks/_gtm_nojs.tpl',
'position' => 150,
],
// details
[
'template' => 'page/details/inc/productmain.tpl',
'block' => 'details_productmain_title',
'file' => '/Application/views/blocks/detail.tpl',
'position' => 150
'block' => 'details_productmain_title',
'file' => 'views/smarty/blocks/view_item.tpl',
'position' => 150,
],
// checkout
// View Cart
[
'template' => 'page/checkout/basket.tpl',
'block' => 'checkout_basket_main',
'file' => '/Application/views/blocks/checkout_s1.tpl'
],
[
'template' => 'form/user_checkout_change.tpl',
'block' => 'user_checkout_change',
'file' => '/Application/views/blocks/checkout_s2.tpl'
],
[
'template' => 'form/user_checkout_register.tpl',
'block' => 'user_checkout_register',
'file' => '/Application/views/blocks/checkout_s2.tpl'
],
[
'template' => 'form/user_checkout_noregister.tpl',
'block' => 'user_checkout_noregister',
'file' => '/Application/views/blocks/checkout_s2.tpl'
],
[
'template' => 'page/checkout/payment.tpl',
'block' => 'checkout_payment_main',
'file' => '/Application/views/blocks/checkout_s3.tpl'
],
[
'template' => 'page/checkout/order.tpl',
'block' => 'checkout_order_main',
'file' => '/Application/views/blocks/checkout_s4.tpl'
],
[
'template' => 'page/checkout/thankyou.tpl',
'block' => 'checkout_thankyou_main',
'file' => '/Application/views/blocks/checkout_s5.tpl'
],
// Lists
// view_item_list
[
'template' => 'widget/product/list.tpl',
'block' => 'd3Ga4_view_item_list',
'file' => '/Application/views/ga4/view_item_list.tpl',
'position' => 150
],
// view_search_result
[
'template' => 'page/search/search.tpl',
'block' => 'search_results',
'file' => '/Application/views/ga4/search.tpl',
'position' => 150
'block' => 'checkout_basket_main',
'file' => 'views/smarty/blocks/view_cart.tpl',
'position' => 150,
],
// add_to_cart
[
'template' => 'page/details/inc/productmain.tpl',
'block' => 'details_productmain_tobasket',
'file' => '/Application/views/ga4/add_to_cart.tpl',
'position' => 150
]
'block' => 'details_productmain_tobasket',
'file' => 'views/smarty/blocks/details_productmain_tobasket.tpl',
'position' => 150,
],
// remove_from_cart
[
'template' => 'page/checkout/basket.tpl',
'block' => 'checkout_basket_main',
'file' => 'views/smarty/blocks/remove_from_cart.tpl',
'position' => 150,
],
[
'template' => 'page/checkout/thankyou.tpl',
'block' => 'checkout_thankyou_main',
'file' => 'views/smarty/blocks/purchase.tpl',
'position' => 150,
],
// Lists
// view_item_list
[
'template' => 'page/list/list.tpl',
'block' => 'page_list_productlist',
'file' => 'views/smarty/blocks/view_item_list.tpl',
'position' => 150,
],
// view_search_result
[
'template' => 'page/search/search.tpl',
'block' => 'search_results',
'file' => 'views/smarty/blocks/view_search_result.tpl',
'position' => 150,
],
[
'template' => 'page/list/list.tpl',
'block' => 'page_list_listbody',
'file' => 'views/smarty/blocks/page_list_listbody.tpl',
'position' => 150,
],
[
'template' => 'page/shop/start.tpl',
'block' => 'start_welcome_text',
'file' => 'views/smarty/blocks/start_welcome_text.tpl',
'position' => 150,
],
// Checkout process
// Begin CHeckout
[
'template' => 'page/checkout/user.tpl',
'block' => 'checkout_user_main',
'file' => 'views/smarty/blocks/begin_checkout.tpl',
'position' => 150,
],
// Add payment info
// We add it into checkout_order_main ( checkout/order.tpl ) to make sure a payment is actually added;
// we'll also do it like that in the future for add_shipping_info ( not planed yet )
[
'template' => 'page/checkout/order.tpl',
'block' => 'checkout_order_main',
'file' => 'views/smarty/blocks/add_payment_info.tpl',
'position' => 150,
],
],
'settings' => [
[
'group' => 'd3_gtm_settings',
'name' => 'd3_gtm_sContainerID',
'type' => 'str',
'value' => 'GTM-',
'position' => 0
],
[
'group' => 'd3_gtm_settings',
'name' => 'd3_gtm_blGA4enab',
'type' => 'bool',
'value' => true,
'position' => 1
],
[
'group' => 'd3_gtm_settings',
'name' => 'd3_gtm_blEnableDebug',
'type' => 'bool',
'value' => false,
'position' => 999
],
[
'group' => 'd3_gtm_settings_cookiemanager',
'name' => 'd3_gtm_settings_hasOwnCookieManager',
'type' => 'bool',
'value' => false,
'position' => 999
],
[
'group' => 'd3_gtm_settings_cookiemanager',
'name' => 'd3_gtm_settings_cookieName',
'type' => 'str',
'value' => 'example',
'position' => 999
],
]
];
'events' => [
'onActivate' => '\D3\GoogleAnalytics4\Setup\Events::onActivate',
'onDeactivate' => '\D3\GoogleAnalytics4\Setup\Events::onDeactivate',
],
];

View File

@ -1,10 +1,15 @@
parameters:
scanFiles:
- IntelliSenseHelper.php
- ../../oxid-esales/oxideshop-ce/source/bootstrap.php
- ../../oxid-esales/oxideshop-ce/source/oxfunctions.php
- ../../oxid-esales/oxideshop-ce/source/overridablefunctions.php
level: 9
phpVersion: 70100
checkMissingIterableValueType: false
scanDirectories:
- ../../oxid-esales
ignoreErrors:
- '#Psr\\Container\\ContainerExceptionInterface is not subtype of Throwable#'
- '#.*is not subtype of Throwable.*#'
paths:
- ./
level: 5
phpVersion: 80100
checkMissingIterableValueType: false

View File

@ -0,0 +1,108 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>[{$title}]</title>
<meta http-equiv="Content-Type" content="text/html; charset=[{$charset}]">
[{if isset($meta_refresh_sec,$meta_refresh_url)}]
<meta http-equiv=Refresh content="[{$meta_refresh_sec}];URL=[{$meta_refresh_url|replace:"&amp;":"&"}]">
[{/if}]
<link rel="shortcut icon" href="[{$oViewConf->getBaseDir()}]favicon.ico">
[{block name="admin_headitem_inccss"}]
<link rel="stylesheet" href="[{$oViewConf->getResourceUrl()}]main.css">
<link rel="stylesheet" href="[{$oViewConf->getResourceUrl()}]colors_[{$oViewConf->getEdition()|lower}].css">
<link rel="stylesheet" type="text/css" href="[{$oViewConf->getResourceUrl()}]yui/build/assets/skins/sam/container.css">
[{/block}]
[{block name="admin_headitem_incjs"}]
<script type="text/javascript" src="[{$oViewConf->getResourceUrl()}]yui/build/utilities/utilities.js"></script>
<script type="text/javascript" src="[{$oViewConf->getResourceUrl()}]yui/build/container/container-min.js"></script>
<script type="text/javascript" src="[{$oViewConf->getResourceUrl()}]yui/oxid-help.js"></script>
[{/block}]
[{block name="admin_headitem_js"}]
<script type="text/javascript">
<!--
// standard messages
var sUnassignMessage = "[{oxmultilang ident='GENERAL_YOUWANTTOUNASSIGN'}]";
var sDeleteMessage = "[{oxmultilang ident='GENERAL_YOUWANTTODELETE'}]";
// class info
var sDefClass = '[{$default_edit}]';
var sActClass = '[{$actlocation}]';
[{if $updatelist == 1}]
window.onload = function ()
{
top.oxid.admin.updateList('[{$oxid}]');
}
[{/if}]
var ajaxpopup = null;
function showDialog( sParams )
{
ajaxpopup = window.open('[{$oViewConf->getSelfLink()|replace:"&amp;":"&"}]'+sParams, 'ajaxpopup', 'width=850,height=680,scrollbars=yes,resizable=yes');
}
function focusPopup()
{
if ( ajaxpopup )ajaxpopup.focus();
}
window.onclick = focusPopup;
function cleanupLongDesc( sValue )
{
if ( sValue == '<br>' || sValue == '<br />' ) {
return '';
}
return sValue;
}
function copyLongDesc( sIdent )
{
var textVal = null;
try {
if ( WPro.editors[sIdent] != null ) {
WPro.editors[sIdent].prepareSubmission();
textVal = cleanupLongDesc( WPro.editors[sIdent].getValue() );
}
} catch(err) {
var varEl = document.getElementById(sIdent);
if (varEl != null) {
textVal = cleanupLongDesc( varEl.value );
}
}
if (textVal == null) {
var varName = 'editor_'+sIdent;
var varEl = document.getElementById(varName);
if (varEl != null) {
textVal = cleanupLongDesc( varEl.value );
}
}
if (textVal != null) {
var oTarget = document.getElementsByName( 'editval['+ sIdent + ']' );
if ( oTarget != null && ( oField = oTarget.item( 0 ) ) != null ) {
oField.value = textVal;
}
}
}
-->
</script>
[{/block}]
</head>
<body>
[{include file="tooltips.tpl"}]
<div id="oxajax_data"></div>
<div class="[{$box|default:'box'}]" style="height: 100%;">
[{include file="inc_error.tpl" Errorlist=$Errors.default}]
<!-- Input help popup -->
<div id="helpTextContainer" class="yui-skin-sam">
<div id="helpPanel"></div>
</div>

View File

@ -0,0 +1,197 @@
[{include file="@d3googleanalytics4/admin/d3ga4uiheaditem.tpl" title="GENERAL_ADMIN_TITLE"|oxmultilangassign}]
<style>
body {
background-image: linear-gradient(to top, #d5d4d0 0%, #d5d4d0 1%, #eeeeec 31%, #efeeec 75%, #e9e9e7 100%);
}
</style>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
[{if $readonly}]
[{assign var="readonly" value="readonly disabled"}]
[{else}]
[{assign var="readonly" value=""}]
[{/if}]
<div>
<form name="d3gtmformedit" id="d3gtmformedit" action="[{$oViewConf->getSelfLink()}]" enctype="multipart/form-data" method="post">
<div class="row">
<div class="col-6">
[{$oViewConf->getHiddenSid()}]
<input type="hidden" name="cl" value="[{$oViewConf->getActiveClassName()}]">
<input type="hidden" name="fnc" value="">
<input type="hidden" name="editlanguage" value="[{$editlanguage}]">
<div class="card mb-5">
<div class="card-header">
[{oxmultilang ident="D3BASECONFIG"}]
</div>
<div class="card-body">
<div class="form-check mb-3">
<input class="form-check-input" type="checkbox" value="" name="editval[bool][_blEnableGa4]" [{if $d3ViewObject->d3GetModuleConfigParam('_blEnableGa4')}]checked[{/if}] id="blGA4enab">
<label class="form-check-label" for="flexCheckDefault">
[{oxmultilang ident="D3ACTIVATEMOD"}] [{if false === $d3ViewObject->d3GetModuleConfigParam('_blEnableGa4')}]<span style="color: red">[{oxmultilang ident="D3INACTIVATEMOD"}]</span>[{/if}]
</label>
</div>
<div class="mb-3">
<div class="input-group w-50">
<span class="input-group-text" id="basic-addon3">[{oxmultilang ident="D3CONTAINERID"}]</span>
<input type="text" class="form-control" id="_sContainerID" name="editval[str][_sContainerID]" aria-describedby="basic-addon3" value="[{$d3ViewObject->d3GetModuleConfigParam('_sContainerID')}]">
</div>
<div class="text-muted">[{oxmultilang ident="D3CONTAINERID_HELP"}]</div>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="_blEnableDebug" name="editval[bool][_blEnableDebug]" [{if $d3ViewObject->d3GetModuleConfigParam('_blEnableDebug')}]checked[{/if}]>
<label class="form-check-label" for="flexCheckDefault">
[{oxmultilang ident="D3USEDEBUGMODE"}][{oxinputhelp ident="D3USEDEBUGMODE_HELP"}]
</label>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="_blActivateConsentMode" name="editval[bool][_blEnableConsentMode]" [{if $d3ViewObject->d3GetModuleConfigParam('_blEnableConsentMode')}]checked[{/if}]>
<label class="form-check-label" for="flexCheckChecked">
[{oxmultilang ident="D3USEGOOGLECONSENTMODE"}][{oxinputhelp ident="D3USEGOOGLECONSENTMODE_HELP"}]
</label>
</div>
</div>
<button type="submit" name="save" class="btn btn-light" onClick="Javascript:document.d3gtmformedit.fnc.value='save'">[{oxmultilang ident="GENERAL_SAVE"}]</button>
</div>
</div>
<div class="col-6">
<div class="card border border-0">
<div class="accordion" id="accordionPanelsStayOpenExample">
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-cmpsettings" aria-expanded="true" aria-controls="panelsStayOpen-cmpsettings">
[{oxmultilang ident="D3CMPTABTITLE"}]
</button>
</h2>
<div id="panelsStayOpen-cmpsettings" class="accordion-collapse collapse show">
<div class="accordion-body">
<div class="form-check">
<input class="form-check-input" type="checkbox" name="editval[bool][_blEnableOwnCookieManager]" value="" id="_hasOwnCookieManager" [{if $d3ViewObject->d3GetModuleConfigParam('_blEnableOwnCookieManager')}]checked[{/if}]>
<label class="form-check-label" for="flexCheckChecked">
[{oxmultilang ident="D3CMPUSEQ"}][{oxinputhelp ident="D3CMPUSEQ_HELP"}]
</label>
</div>
<div class="mb-3">
<label>
[{oxmultilang ident="D3CMP"}]
</label>
<select class="form-select w-50" name="editval[select][_HAS_STD_MANAGER]" aria-label="Default select example">
[{foreach from=$d3ManagerTypeArray key="sInternalName" item="sPublicName" name="editval[aCmpNameArray]"}]
<option value="[{$sInternalName}]" [{if $sInternalName === $d3CurrentCMP}]SELECTED[{/if}]>[{$sPublicName}]</option>
[{/foreach}]
</select>
</div>
<div>
<div class="input-group w-75">
<span class="input-group-text" id="basic-addon3">[{oxmultilang ident="D3CNTRLPARAM"}]</span>
<input type="text" class="form-control" id="_controlParameter" name="editval[str][_sControlParameter]" value="[{$d3ViewObject->d3GetModuleConfigParam('_sControlParameter')}]" aria-describedby="basic-addon3">
</div>
<div class="text-muted">[{oxmultilang ident="D3CNTRLPARAM_HELP"}]</div>
</div>
</div>
<button type="submit" name="save" class="btn btn-light w-100" onClick="Javascript:document.d3gtmformedit.fnc.value='save'">[{oxmultilang ident="GENERAL_SAVE"}]</button>
</div>
</div>
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-serversidetagging" aria-expanded="false" aria-controls="panelsStayOpen-serversidetagging">
[{oxmultilang ident="D3SERVERSIDETAGGING"}]
</button>
</h2>
<div id="panelsStayOpen-serversidetagging" class="accordion-collapse collapse">
<div class="accordion-body">
<div class="card bg-light rounded mb-3">
<div class="card-body">
[{oxmultilang ident="D3SERVERSIDETAGGING_HINT"}]
</div>
</div>
<div class="input-group mb-3">
<span class="input-group-text w-25" id="basic-addon3">[{oxmultilang ident="D3SERVERSIDETAGGING_TITLE_ACTIVE"}]</span>
<input type="text" class="form-control" id="_serversidetagging_js" name="editval[str][_sServersidetagging_js]" value="[{$d3ViewObject->d3GetModuleConfigParam('_sServersidetagging_js')}]" aria-describedby="basic-addon3">
</div>
<div class="input-group mb-3">
<span class="input-group-text w-25" id="basic-addon3">[{oxmultilang ident="D3SERVERSIDETAGGING_TITLE_PASSIVE"}]</span>
<input type="text" class="form-control" id="_serversidetagging_nojs" name="editval[str][_sServersidetagging_nojs]" value="[{$d3ViewObject->d3GetModuleConfigParam('_sServersidetagging_nojs')}]" aria-describedby="basic-addon3">
</div>
<div>
<button type="button" class="btn btn-light mt-3" data-bs-toggle="modal" data-bs-target="#exampleModal">
[{oxmultilang ident="D3DETAILED_DESC"}]
</button>
<!-- Modal -->
<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">
<h4>[{oxmultilang ident="D3SERVERSIDETAGGING_TITLE_ACTIVE"}]</h4>
[{oxmultilang ident="D3SERVERSIDETAGGING_ACTIVE"}]
<hr>
<h4>[{oxmultilang ident="D3SERVERSIDETAGGING_TITLE_PASSIVE"}]</h4>
[{oxmultilang ident="D3SERVERSIDETAGGING_PASSIVE"}]
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">[{oxmultilang ident="D3CLOSE"}]</button>
</div>
</div>
</div>
</div>
</div>
</div>
<button type="submit" name="save" class="btn btn-light w-100" onClick="Javascript:document.d3gtmformedit.fnc.value='save'">[{oxmultilang ident="GENERAL_SAVE"}]</button>
</div>
</div>
[{if $d3ViewConfObject->d3IsUsercentricsCMPChosen()}]
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#panelsStayOpen-usercentricsdynamicoptions" aria-expanded="false" aria-controls="panelsStayOpen-usercentricsdynamicoptions">
[{oxmultilang ident="D3USRCNTRCSDYNOPT"}]
</button>
</h2>
<div id="panelsStayOpen-usercentricsdynamicoptions" class="accordion-collapse collapse">
<div class="accordion-body">
<div class="card bg-light rounded mb-3">
<div class="card-body">
<div class="text-danger mb-3">
[{oxmultilang ident="D3USRCNTRCSCFG_WARNING"}]
</div>
[{oxmultilang ident="D3USRCNTRCSCFG_DOCS"}]
</div>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="enabledefaultmeasurementvalues" name="editval[bool][_blEnableMeasurementCapabilities]" [{if $d3ViewObject->d3GetModuleConfigParam('_blEnableMeasurementCapabilities')}]checked[{/if}]>
<label class="form-check-label" for="flexCheckDefault">
[{oxmultilang ident="D3USRCNTRCSCFG_ACT_INDIVDEFVAL"}]
</label>
</div>
<div class="input-group mb-3">
<span class="input-group-text w-25" id="basic-addon3">[{oxmultilang ident="D3USRCNTRCSCFG_STD_CNST"}]</span>
<textarea name="editval[str][_sMeasurementCapabilities]" class="form-control" rows="15">[{$d3ViewObject->d3GetModuleConfigParam('_sDefaultMeasurementCapabilities')}]</textarea>
</div>
<div class="form-check">
<input class="form-check-input" type="checkbox" value="" id="enableUsercentricsConsentModeApi" name="editval[bool][_blEnableUsercentricsConsentModeApi]" [{if $d3ViewObject->d3GetModuleConfigParam('_blEnableUsercentricsConsentModeApi')}]checked[{/if}]>
<label class="form-check-label" for="flexCheckDefault">
[{oxmultilang ident="D3USRCNTRCSCFG_ACT_CNSTMDE_API"}]
</label>
</div>
<div class="input-group mb-3">
<span class="input-group-text w-25" id="basic-addon3">[{oxmultilang ident="D3USRCNTRCSCFG_CNSTMDE_API"}]</span>
<textarea name="editval[str][_sUsercentricsConsentModeApi]" class="form-control" rows="40">[{$d3ViewObject->d3GetModuleConfigParam('_sDefaultUsercentricsConsentModeApi')}]</textarea>
</div>
</div>
<button type="submit" name="save" class="btn btn-light w-100" onClick="Javascript:document.d3gtmformedit.fnc.value='save'">[{oxmultilang ident="GENERAL_SAVE"}]</button>
</div>
</div>
[{/if}]
</div>
</div>
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,55 @@
[{* Always prepare the data layer to avoid errors *}]
[{if $oViewConf->isGA4enabled()}]
[{assign var="d3GtmContainerIdString" value=$oViewConf->getGtmContainerId()}]
<script>
var dataLayer = [{$oViewConf->getGtmDataLayer()}] || [];
</script>
[{/if}]
[{if $oViewConf->isGA4enabled() and $oViewConf->D3blShowGtmScript()}]
[{if $d3GtmContainerIdString}]
[{strip}]
[{if $oViewConf->isGtmConsentModeSetActivated()}]
<script type="text/javascript">
[{if $oViewConf->d3IsUsercentricsCMPChosen() and $oViewConf->d3GetModuleConfigParam('_blEnableMeasurementCapabilities')}]
[{$oViewConf->d3GetModuleConfigParam('_sMeasurementCapabilities')|strip}]
[{else}]
function gtag() {
dataLayer.push(arguments);
}
gtag("consent", "default", {
ad_user_data: "denied",
ad_personalization: "denied",
ad_storage: "denied",
analytics_storage: "denied",
wait_for_update: 2000
});
[{/if}]
</script>
[{/if}]
[{if $oViewConf->d3IsUsercentricsCMPChosen() and $oViewConf->d3GetModuleConfigParam('_blEnableUsercentricsConsentModeApi')}]
<script type="text/javascript">
[{$oViewConf->d3GetModuleConfigParam('_sUsercentricsConsentModeApi')|strip}]
</script>
[{/if}]
<!-- Google Tag Manager -->
<script [{$oViewConf->getGtmScriptAttributes()}]>
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({'gtm.start': new Date().getTime(), event: 'gtm.js'});
var f = d.getElementsByTagName(s)[0], j = d.createElement(s), dl = l != 'dataLayer' ? '&l=' + l : '';
j.async = true;
j.src = '[{$oViewConf->getServerSidetaggingJsDomain()}]?id=' + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, 'script', 'dataLayer', '[{$d3GtmContainerIdString}]');
</script>
<!-- End Google Tag Manager -->
[{/strip}]
[{/if}]
[{/if}]
[{$smarty.block.parent}]

View File

@ -0,0 +1,12 @@
[{if $oViewConf->D3blShowGtmScript()}]
[{if $oViewConf->getGtmContainerId()}][{strip}]
<!-- Google Tag Manager (noscript) -->
<noscript>
<iframe src="[{$oViewConf->getServerSidetaggingNoJsDomain()}]?id=[{$oViewConf->getGtmContainerId()}]"
height="0" width="0" style="display:none;visibility:hidden"></iframe>
</noscript>
<!-- End Google Tag Manager (noscript) -->
[{/strip}][{/if}]
[{/if}]
[{$smarty.block.parent}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/add_payment_info.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/begin_checkout.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/purchase.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/remove_from_cart.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/view_cart.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/view_item.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/view_item_list.tpl"}]

View File

@ -0,0 +1,3 @@
[{$smarty.block.parent}]
[{include file="@d3googleanalytics4/event/view_search_result.tpl"}]

View File

@ -0,0 +1,53 @@
[{*$oxcmp_basket|get_class_methods|dumpvar*}]
[{assign var="gtmBasketPrice" value=$oxcmp_basket->getPrice()}]
[{assign var="gtmBasketObject" value=$oxcmp_basket}]
[{assign var='gtmCartArticles' value=$gtmBasketObject->getBasketArticles()}]
[{assign var="gtmPaymentObject" value=$oView->getPayment()}]
[{block name="gtm_ga4_add_payment_info_block"}]
[{capture name="gtm_ga4_add_payment_info"}]
[{strip}]
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'add_payment_info',
'eventLabel':'Checkout - Payment info',
'payment_type':'[{$gtmPaymentObject->gtmGetSelectedPaymentName()}]',
'ecommerce':
{
'actionField': "Payment-Info",
'currency': "[{$currency->name}]",
'value': [{$gtmBasketPrice->getPrice()}],
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
'items':
[
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
[{assign var="gtmItemPriceObject" value=$basketitem->getPrice()}]
[{assign var="gtmBasketItem" value=$basketitem->getArticle()}]
[{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}]
{
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]',
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
[{if $gtmBasketItemCategory}]
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]',
'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]',
'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]',
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
[{/if}]
'price': [{$gtmItemPriceObject->getPrice()}],
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
'quantity': [{$basketitem->getAmount()}],
'position': [{$smarty.foreach.gtmCartContents.index}]
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
[{/foreach}]
]
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
});
[{/strip}]
[{/capture}]
[{oxscript add=$smarty.capture.gtm_ga4_add_payment_info}]
[{/block}]

View File

@ -0,0 +1,61 @@
[{if $d3CmpBasket && $d3CmpBasket->getAddToBasketDecision() && $d3CmpBasket->d3GtmRequestedArticleLoadedByAnid() !== null}]
[{assign var="oGtmProduct" value=$d3CmpBasket->d3GtmRequestedArticleLoadedByAnid()}]
[{assign var="oGtmAmountArticlesAdded" value=$d3CmpBasket->getD3GtmAddToCartAmountArticles()}]
[{*$smarty.block.parent*}]
[{* variable $oGtmProduct is passed from parent tempalte *}]
[{assign var="d3PriceObject" value=$oGtmProduct->getPrice()}]
[{assign var="gtmCurrency" value=$oView->getActCurrency()}]
[{assign var="gtmManufacturer" value=$oGtmProduct->getManufacturer()}]
[{assign var="gtmCategory" value=$oGtmProduct->getCategory()}]
[{block name="d3_ga4_add_to_cart_list_block"}]
[{capture name="d3_ga4_add_to_cart_listtpl"}]
[{strip}]
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
[{*** Debug cases ***}]
[{*event.preventDefault();*}]
let iArtQuantity = $("[{$htmlIdAmountOfArticles}]").val();
let iArtQuantityAdded = [{$oGtmAmountArticlesAdded}];
if(!iArtQuantity && (iArtQuantityAdded === 1)){
iArtQuantity = 1;
}else{
iArtQuantity = iArtQuantityAdded;
}
dataLayer.push({
'isAddToBasket': true,
'event':'add_to_cart',
'eventLabel': 'add_to_cart',
'ecommerce': {
'currency': "[{$currency->name}]",
'value': iArtQuantity*[{$d3PriceObject->getPrice()}],
'items': [
{
'item_id': '[{$oGtmProduct->getFieldData('oxartnum')}]',
'item_name': '[{$oGtmProduct->getFieldData('oxtitle')}]',
'price': [{$d3PriceObject->getPrice()}],
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
'item_variant': '[{if $oGtmProduct->getFieldData('oxvarselect')}][{$oGtmProduct->getFieldData('oxvarselect')}][{/if}]',
[{if $gtmCategory}]
'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]',
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1, true)}]',
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2, true)}]',
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3, true)}]',
'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
[{/if}]
'quantity': iArtQuantity
}
]
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
});
[{/strip}]
[{/capture}]
[{oxscript add=$smarty.capture.d3_ga4_add_to_cart_listtpl}]
[{/block}]
[{/if}]

View File

@ -0,0 +1,52 @@
[{*$oxcmp_basket|get_class_methods|dumpvar*}]
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
[{assign var="d3BasketObject" value=$oxcmp_basket}]
[{assign var='gtmCartArticles' value=$d3BasketObject->getBasketArticles()}]
[{assign var="gtmCurrency" value=$oView->getActCurrency()}]
[{block name="d3_ga4_begin_checkout_block"}]
[{capture name="d3_ga4_begin_checkout"}]
[{strip}]
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'begin_checkout',
'eventLabel':'Begin of checkout',
'ecommerce':
{
'actionField': "Begin",
'currency': "[{$gtmCurrency->name}]",
'value': [{$d3BasketPrice->getPrice()}],
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
'items':
[
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
[{assign var="d3oItemPrice" value=$basketitem->getPrice()}]
[{assign var="gtmBasketItem" value=$basketitem->getArticle()}]
[{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}]
{
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]',
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
[{if $gtmBasketItemCategory}]
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]',
'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]',
'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]',
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
[{/if}]
'price': [{$d3oItemPrice->getPrice()}],
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
'quantity': [{$basketitem->getAmount()}],
'position': [{$smarty.foreach.gtmCartContents.index}]
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
[{/foreach}]
]
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
});
[{/strip}]
[{/capture}]
[{oxscript add=$smarty.capture.d3_ga4_begin_checkout}]
[{/block}]

View File

@ -0,0 +1,56 @@
[{block name="d3_ga4_purchase_block"}]
[{capture name="d3_ga4_purchase"}]
[{strip}]
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
[{assign var="gtmOrder" value=$oView->getOrder()}]
[{assign var="gtmBasket" value=$oView->getBasket()}]
[{assign var="gtmArticles" value=$gtmOrder->getOrderArticles()}]
[{assign var="gtmOrderVouchers" value=$gtmOrder->getVoucherNrList()}]
dataLayer.push({
'event': 'purchase',
'eventLabel':'Checkout Step 5',
'ecommerce':
{
'transaction_id': '[{$gtmOrder->getFieldData("oxordernr")}]',
'affiliation': '[{$oxcmp_shop->getFieldData("oxname")}]',
'value': [{$gtmOrder->getTotalOrderSum()}],
'tax': [{math equation="x+y" x=$gtmOrder->getFieldData("oxartvatprice1") y=$gtmOrder->getFieldData("oxartvatprice2") }],
'shipping': [{$gtmOrder->getFieldData("oxdelcost")}],
'currency': '[{$gtmOrder->getFieldData('oxcurrency')}]',
'coupon': '[{foreach from=$gtmOrderVouchers item="gtmOrderVoucher" name="gtmOrderVoucherIteration"}][{$gtmOrderVoucher}][{if !$smarty.foreach.gtmOrderVoucherIteration.last}], [{/if}][{/foreach}]',
'paymentType': '[{$gtmBasket->getPaymentOnPaymentId()}]',
'items':
[
[{foreach from=$gtmArticles item="gtmBasketItem" name="gtmArticles"}]
[{assign var="gtmPurchaseItemPriceObject" value=$gtmBasketItem->getPrice()}]
[{assign var="gtmPurchaseItem" value=$gtmBasketItem->getArticle()}]
[{assign var="gtmPurchaseItemCategory" value=$gtmPurchaseItem->getCategory()}]
{
'item_id': '[{$gtmBasketItem->getFieldData("oxartnum")}]',
'item_name': '[{$gtmBasketItem->getFieldData("oxtitle")}]',
'affiliation': '[{$gtmBasketItem->getFieldData("oxtitle")}]',
'coupon': '[{foreach from=$gtmOrderVouchers item="gtmOrderVoucher" name="gtmOrderVoucherIteration"}][{$gtmOrderVoucher}][{if !$smarty.foreach.gtmOrderVoucherIteration.last}], [{/if}][{/foreach}]',
'item_variant': '[{$gtmBasketItem->getFieldData("oxselvariant")}]',
[{if $gtmPurchaseItemCategory}]
'item_category': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(0, true)}]',
'item_category_2': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(1, true)}]',
'item_category_3': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(2, true)}]',
'item_category_4': '[{$gtmPurchaseItemCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmPurchaseItemCategory->getSplitCategoryArray()}]',
[{/if}]
'price': [{$gtmPurchaseItemPriceObject->getPrice()}],
'quantity': [{$gtmBasketItem->getFieldData("oxamount")}],
'position': [{$smarty.foreach.gtmArticles.iteration}]
}[{if !$smarty.foreach.gtmArticles.last}],[{/if}]
[{/foreach}]
]
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
})
[{/strip}]
[{/capture}]
[{oxscript add=$smarty.capture.d3_ga4_purchase}]
[{/block}]

View File

@ -0,0 +1,46 @@
[{block name="d3_ga4_remove_from_cart_block"}]
[{if $hasBeenReloaded}]
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
[{capture name="d3_ga4_remove_from_cart"}]
[{strip}]
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'isRemoveFromCart': true,
'event': 'remove_from_cart',
'eventLabel':'remove_from_cart',
'ecommerce': {
'actionField': "step: 1",
'currency': "[{$currency->name}]",
'value': [{$d3BasketPrice->getPrice()}],
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
'items': [
[{foreach from=$toRemoveArticles->getArray() name=gtmRemovedItems item=rmItem key=rmItemindex}]
[{assign var="d3oItemPrice" value=$rmItem->getPrice()}]
[{assign var="gtmBasketItemCategory" value=$rmItem->getCategory()}]
{
'item_id': '[{$rmItem->getFieldData('oxartnum')}]',
'item_name': '[{$rmItem->getFieldData('oxtitle')}]',
'item_variant': '[{$rmItem->getFieldData('oxvarselect')}]',
[{if $gtmBasketItemCategory}]
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]',
'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]',
'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]',
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
[{/if}]
'price': [{$d3oItemPrice->getPrice()}],
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
'quantity': '[{$rmItem->getFieldData('d3AmountThatGotRemoved')}]',
'position': [{$smarty.foreach.gtmRemovedItems.index}]
}[{if !$smarty.foreach.gtmRemovedItems.last}],[{/if}]
[{/foreach}]
]
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
});
[{/strip}]
[{/capture}]
[{oxscript add=$smarty.capture.d3_ga4_remove_from_cart}]
[{/if}]
[{/block}]

View File

@ -0,0 +1,50 @@
[{*$oxcmp_basket|get_class_methods|dumpvar*}]
[{assign var="d3BasketPrice" value=$oxcmp_basket->getPrice()}]
[{assign var='gtmCartArticles' value=$oView->getBasketArticles()}]
[{block name="d3_ga4_view_cart_block"}]
[{capture name="d3_ga4_view_cart"}]
[{strip}]
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'view_cart',
'eventLabel':'Checkout Step 1',
'ecommerce':
{
'actionField': "step: 1",
'currency': "[{$currency->name}]",
'value': [{$d3BasketPrice->getPrice()}],
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
'items':
[
[{foreach from=$oxcmp_basket->getContents() item=basketitem name=gtmCartContents key=basketindex}]
[{assign var="d3oItemPrice" value=$basketitem->getPrice()}]
[{assign var="gtmBasketItem" value=$basketitem->getArticle()}]
[{assign var="gtmBasketItemCategory" value=$gtmBasketItem->getCategory()}]
{
'item_id': '[{$gtmCartArticles[$basketindex]->getFieldData('oxartnum')}]',
'item_name': '[{$gtmCartArticles[$basketindex]->getFieldData('oxtitle')}]',
'item_variant': '[{$gtmCartArticles[$basketindex]->getFieldData('oxvarselect')}]',
[{if $gtmBasketItemCategory}]
'item_category': '[{$gtmBasketItemCategory->getSplitCategoryArray(0, true)}]',
'item_category_2': '[{$gtmBasketItemCategory->getSplitCategoryArray(1, true)}]',
'item_category_3': '[{$gtmBasketItemCategory->getSplitCategoryArray(2, true)}]',
'item_category_4': '[{$gtmBasketItemCategory->getSplitCategoryArray(3, true)}]',
'item_list_name': '[{$gtmBasketItemCategory->getSplitCategoryArray()}]',
[{/if}]
'price': [{$d3oItemPrice->getPrice()}],
'coupon': '[{foreach from=$oxcmp_basket->getVouchers() item=sVoucher key=key name=Voucher}][{$sVoucher->sVoucherNr}][{if !$smarty.foreach.Voucher.last}], [{/if}][{/foreach}]',
'quantity': [{$basketitem->getAmount()}],
'position': [{$smarty.foreach.gtmCartContents.index}]
}[{if !$smarty.foreach.gtmCartContents.last}],[{/if}]
[{/foreach}]
]
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
});
[{/strip}]
[{/capture}]
[{oxscript add=$smarty.capture.d3_ga4_view_cart}]
[{/block}]

View File

@ -0,0 +1,41 @@
[{assign var="gtmProduct" value=$oView->getProduct()}]
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
[{block name="d3_ga4_view_item_block"}]
[{capture name="d3_ga4_view_item"}]
[{strip}]
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'view_item',
'eventLabel':'Product View',
'ecommerce':
{
'currency': '[{$currency->name}]',
'items':
[
{
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
'item_variant': '[{if $gtmProduct->getFieldData("oxvarselect")}][{$gtmProduct->getFieldData("oxvarselect")}][{/if}]',
[{if $gtmCategory}]
'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]',
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1, true)}]',
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2, true)}]',
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3, true)}]',
'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
[{/if}]
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
'price': [{$d3PriceObject->getPrice()}]
}
]
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
});
[{/strip}]
[{/capture}]
[{oxscript add=$smarty.capture.d3_ga4_view_item}]
[{/block}]

View File

@ -0,0 +1,45 @@
[{assign var="gtmProducts" value=$oView->getArticleList()}]
[{assign var="gtmCategory" value=$oView->getActiveCategory()}]
[{assign var="breadCrumb" value=''}]
[{block name="d3_ga4_view_item_list_block"}]
[{if $gtmProducts|@count}]
[{capture name="d3_ga4_view_item_list"}]
[{strip}]
dataLayer.push({ecommerce: null});
dataLayer.push({
'event':'view_item_list',
'event_name': 'view_item_list',
'ecommerce': {
'item_list_id': '[{$oView->getCategoryId()}]',
'item_list_name': '[{foreach from=$oView->getBreadCrumb() item=sCrum}][{if $sCrum.title }][{$breadCrumb|cat:$sCrum.title|cat:" > "}][{/if}][{/foreach}]',
'items': [
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
[{if !$gtmCategory}][{assign var="gtmCategory" value=$gtmProduct->getCategory()}][{/if}]
{
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
'price': [{$d3PriceObject->getPrice()}],
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
[{if $gtmCategory}]
'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]',
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1, true)}]',
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2, true)}]',
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3, true)}]',
[{/if}]
'quantity': 1
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
[{/foreach}]
]
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
});
[{/strip}]
[{/capture}]
[{oxscript add=$smarty.capture.d3_ga4_view_item_list}]
[{/if}]
[{/block}]

View File

@ -0,0 +1,44 @@
[{assign var="gtmProducts" value=$oView->getArticleList()}]
[{block name="d3_ga4_view_search_result_block"}]
[{if $gtmProducts}]
[{capture name="d3_ga4_view_search_result"}]
[{strip}]
dataLayer.push({"event": null, "eventLabel": null, "ecommerce": null}); /* Clear the previous ecommerce object. */
dataLayer.push({
'event': 'view_search_result',
'eventLabel':'view_search_result[{if $oViewConf->isDebugModeOn()}]_test[{/if}]',
'ecommerce': {
'search_term': '[{$searchparamforhtml}]',
'items': [
[{foreach from=$gtmProducts name="gtmProducts" item="gtmProduct"}]
[{assign var="d3PriceObject" value=$gtmProduct->getPrice()}]
[{assign var="gtmManufacturer" value=$gtmProduct->getManufacturer()}]
[{assign var="gtmCategory" value=$gtmProduct->getCategory()}]
{
'item_id': '[{$gtmProduct->getFieldData("oxartnum")}]',
'item_name': '[{$gtmProduct->getFieldData("oxtitle")}]',
'price': [{$d3PriceObject->getPrice()}],
'item_brand': '[{if $gtmManufacturer}][{$gtmManufacturer->oxmanufacturers__oxtitle->value}][{/if}]',
[{if $gtmCategory}]
'item_category': '[{$gtmCategory->getSplitCategoryArray(0, true)}]',
'item_category_2':'[{$gtmCategory->getSplitCategoryArray(1, true)}]',
'item_category_3':'[{$gtmCategory->getSplitCategoryArray(2, true)}]',
'item_category_4':'[{$gtmCategory->getSplitCategoryArray(3, true)}]',
'item_list_name':'[{$gtmCategory->getSplitCategoryArray()}]',
[{/if}]
'quantity': 1
}[{if !$smarty.foreach.gtmProducts.last}],[{/if}]
[{/foreach}]
]
}[{if $oViewConf->isDebugModeOn()}],
'debug_mode': 'true'
[{/if}]
});
[{/strip}]
[{/capture}]
[{oxscript add=$smarty.capture.d3_ga4_view_search_result}]
[{/if}]
[{/block}]
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]

View File

@ -0,0 +1,18 @@
[{capture append="oxidBlock_content"}]
[{assign var="template_title" value="MY_WISH_LIST"|oxmultilangassign}]
<h1 class="page-header">[{oxmultilang ident="MY_WISH_LIST"}]</h1>
[{if $oView->getNoticeProductList()}]
[{include file="widget/product/list.tpl" type="line" listId="noticelistProductList" title="" products=$oView->getNoticeProductList() removeFunction="tonoticelist" owishid=$oxcmp_user->oxuser__oxid->value}]
[{else}]
<p class="alert alert-info">[{oxmultilang ident="WISH_LIST_EMPTY"}]</p>
[{/if}]
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]
[{insert name="oxid_tracker" title=$template_title}]
[{/capture}]
[{capture append="oxidBlock_sidebar"}]
[{include file="page/account/inc/account_menu.tpl" active_link="noticelist"}]
[{/capture}]
[{include file="layout/page.tpl" sidebar="Left"}]

View File

@ -0,0 +1,32 @@
[{capture append="oxidBlock_content"}]
[{assign var="template_title" value="LISTMANIA"|oxmultilangassign}]
[{assign var="_actvrecommlist" value=$oView->getActiveRecommList()}]
<h1 class="page-header">[{oxmultilang ident="LISTMANIA"}]</h1>
[{if $oView->isSavedList()}]
[{assign var="_statusMessage" value="LISTMANIA_LIST_SAVED"|oxmultilangassign}]
[{include file="message/success.tpl" statusMessage=$_statusMessage}]
[{/if}]
[{block name="account_redommendationlist_content"}]
[{include file="form/recommendation_edit.tpl" actvrecommlist=$_actvrecommlist}]
<hr>
[{if !$oView->getActiveRecommList()}]
[{assign var="blEdit" value=true}]
[{include file="page/recommendations/inc/list.tpl"}]
[{/if}]
[{/block}]
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]
[{insert name="oxid_tracker" title=$template_title}]
[{/capture}]
[{capture append="oxidBlock_sidebar"}]
[{include file="page/account/inc/account_menu.tpl" active_link="recommendationlist"}]
[{/capture}]
[{include file="layout/page.tpl" sidebar="Left"}]

View File

@ -0,0 +1,44 @@
[{capture append="oxidBlock_content"}]
[{assign var="template_title" value="MY_GIFT_REGISTRY"|oxmultilangassign}]
[{if !$oView->getWishListUsers() && $oView->getWishListSearchParam()}]
[{assign var="_statusMessage" value="MESSAGE_SORRY_NO_GIFT_REGISTRY"|oxmultilangassign}]
[{include file="message/error.tpl" statusMessage=$_statusMessage}]
[{/if}]
[{assign var="editval" value=$oView->getEnteredData()}]
[{if $oView->isWishListEmailSent()}]
[{assign var="_statusMessage" value="GIFT_REGISTRY_SENT_SUCCESSFULLY"|oxmultilangassign:$editval->rec_email}]
[{include file="message/notice.tpl" statusMessage=$_statusMessage}]
[{/if}]
<h1 class="page-header">[{$oView->getTitle()}]</h1>
<div class="wishlist-search">
[{include file="form/wishlist_search.tpl" searchClass="account_wishlist"}]
</div>
<hr>
<div class="wishlist">
[{if $oView->getWishList()}]
[{include file="form/wishlist_publish.tpl"}]
<hr>
[{include file="form/wishlist_suggest.tpl"}]
[{/if}]
</div>
[{if $oView->getWishList()}]
[{include file="widget/product/list.tpl" type="line" listId="wishlistProductList" title="" products=$oView->getWishProductList() removeFunction="towishlist" toBasketFunction="tobasket" owishid=$oxcmp_user->oxuser__oxid->value}]
[{else}]
<p class="alert alert-info">
[{oxmultilang ident="GIFT_REGISTRY_EMPTY"}]
</p>
[{/if}]
[{include file='@d3googleanalytics4/event/add_to_cart.tpl' htmlIdAmountOfArticles='#amountToBasket'}]
[{insert name="oxid_tracker" title=$template_title}]
[{/capture}]
[{capture append="oxidBlock_sidebar"}]
[{include file="page/account/inc/account_menu.tpl" active_link="wishlist"}]
[{/capture}]
[{include file="layout/page.tpl" sidebar="Left"}]