2 |
3 | # Google Tag Manager for Magento 2 / Adobe Commerce with Advance Data Layer
4 |
5 | [](https://packagist.org/packages/magepal/magento2-googletagmanager)
6 | [](https://packagist.org/packages/magepal/magento2-googletagmanager)
7 |
8 | #### Whether you are a small Magento retailer or an Adobe Commerce Enterprise customer, our suite of Google Tag Manager extensions will help you integrate the most challenging GTM projects within days, instead of spending weeks or months creating custom solutions.
9 | For Magento 2.0.x, 2.1.x, 2.2.x, 2.3.x and 2.4.x
10 |
11 |
12 |
13 | ### What is Google Tag Manager
14 | Google Tag Manager (GTM) is a user-friendly, powerful and essential integration for every Magento store. It simplifies
15 | the process of adding, editing and managing third-party JavaScript tags and other snippets of code on your Magento site.
16 | With GTM, you can quickly and easily add Facebook tags, AdWords Conversion Tracking, Re-marketing, Bing UET, SnapChat,
17 | DoubleClick code, Google Analytics, and many more in a breeze without the need for a developer to make changes to your
18 | Magento code providing the data is available to Google Tag Manager.
19 |
20 | Google Tag Manager makes running your digital marketing campaigns much easier when calibrating with multiple department and Ad agencies by making available the right set of tools so that everyone can get their job done quickly without relying on developers.
21 |
22 | Without having the all data you need at your fingertips your integration will become a difficult, time-consuming and messy since each developer will only focus on the current task at hand instead of focusing on writing reusable components for future integration.
23 |
24 | Our extension provides a vast array of over 60 preconfigure data layer elements to make integrating your Magento store with any other third-party service a breeze using Google Tag Manager.
25 | Extracting, customizing and adding your own custom data from your Magento store to Google Tag Manager is as easy as 10 lines of code using our easy to customize APIs.
26 |
27 | >:warning: Google Tag Manager 2.7.0 has some breaking changes to Enhanced Ecommerce. Please download the latest version of Enhanced Ecommerce 1.7.0 or greater from www.magepal.com account.
28 |
29 |
30 | ### Why use our Google Tag Manager extension?
31 | Adding Google Tag Manager code snippet to the header section of your Magento / Adobe Commerce store may seem like the ideal,
32 | and most efficient way to add GTM to your site. But this will not be sufficient and limit your ability to take
33 | full advantage of GTM when integrating third-parties tracking codes that require data from your Magento stores,
34 | such as product name, price, items added to cart, order items, total, shipping amount or any other data. Our extension
35 | provides hundreds of data elements and events to accomplish any integration and provides the building block to make
36 | your next integration a success. With a few lines of code, you can quickly extend our extension to accomplish your
37 | most challenging integration. Google Tag Manager is only as powerful as the data layer powering it.
38 | Learn more about [customizing Google Tag Manger](https://www.magepal.com/help/docs/google-tag-manager-for-magento/#api).
39 |
40 | ### Google Analytics 4
41 | Upgrade to the next generation of tracking from Google. [Google Analytics 4](https://www.magepal.com/google-analytics-4-for-google-tag-manager.html?utm_source=ga4%20for%20Google%20Tag%20Manager&utm_medium=github) comes with a bunch of key features that make it very different and more powerful than Enhanced Ecommerce.
42 | Gain access to GA4 new approach to privacy-first tracking, channel measurement, and AI based predictive data with MagePal Google Analytics 4 Extension.
43 |
44 | ### Google Analytics Enhanced E-commerce
45 | Want to track more? Upgrade to our new [Enhanced E-commerce for Google Tag Manager](https://www.magepal.com/enhanced-ecommerce-for-google-tag-manager.html?utm_source=Enhanced%20Ecommerce%20for%20Google%20Tag%20Manager&utm_medium=github) to take full advantage of Google Analytics most powerful e-commerce features.
46 | Gain valuable insight and increase your conversion rate by leveraging Google Enhanced Ecommerce to better understand your user actions and behaviors.
47 |
48 | Learn more about our [Google Enhanced Ecommerce](https://www.magepal.com/enhanced-ecommerce-for-google-tag-manager.html?utm_source=Enhanced%20Ecommerce%20for%20Google%20Tag%20Manager&utm_medium=github) extension today. A small increase in your store’s conversion rate can make a giant impact on your revenue.
49 |
50 | ### Third Party Integration with Google Tag Manager
51 | Adding Facebook pixel, Bing UAT, SnapChat or any other third-party code snippet to your website but frustrated by
52 | all the hassle and time it takes to configure Google Tag Manager? Learn how simple and easy it is to integrate any
53 | tracking code to your Magento store with our new [DataLayer extension](https://www.magepal.com/datalayer-for-google-tag-manager.html?utm_source=data%20layer%20for%20Google%20Tag%20Manager&utm_medium=github).
54 |
55 | ### General Data Protection Regulation (GDPR) Support
56 | Now you can quickly disable analytic tracking for customers' who do not want to by track by enabling Cookie Restriction
57 | Mode or base on existing or non-existing cookie.
58 |
59 | - Stores > Configuration > General > Web > Default Cookie Settings > Cookie Restriction Mode.
60 |
61 | Please Note: Merchants should consult with their own legal counsel to ensure that they are compliant with the GDPR.
62 |
63 | ### Get more from Google Tag Manager with our add-on Extensions
64 |
65 | | Features | GTM | EE | GA4 | DL |
66 | |-----------------------------|:---:|:---:|:---:|:---:|
67 | | Global Page Tracking | X | X | X | |
68 | | Order Conversion Tracking | X | X | X | |
69 | | Page Type Event | | X | X | |
70 | | Product Clicks | | X | X | |
71 | | Product Detail Impressions | | X | X | |
72 | | Add to Cart | | X | X | |
73 | | Remove from Cart | | X | X | |
74 | | Checkout Steps | | X | X | |
75 | | Order Refunds | | X | X | |
76 | | Admin Order Tracking | | X | X | |
77 | | Access DataLayer using JS | | | | X |
78 | | Bing UET Tracking | | | | X |
79 | | Full Facebook Tracking | | | | X |
80 | | Custom Image Pixel Tracking | | | | X |
81 | | Custom iFrame Tracking | | | | X |
82 | | Third-Party Integration | | | | X |
83 | | Extend individual page type | | | | X |
84 |
85 | GTM - [Google Tag Manager for Magento 2 Extension](https://www.magepal.com/magento2/extensions/google-tag-manager.html)
86 |
87 | GA4 - [Google Analytics 4 for Google Tag Manager Extension](https://www.magepal.com/magento2/extensions/google-analytics-4-for-google-tag-manager.html)
88 |
89 | EE - [Enhanced E-commerce for Google Tag Manager Extension](https://www.magepal.com/magento2/extensions/enhanced-ecommerce-for-google-tag-manager.html)
90 |
91 | DL - [DataLayer for Google Tag Manager Extension](https://www.magepal.com/magento2/extensions/datalayer-for-google-tag-manager.html)
92 |
93 |
94 | ### Features
95 | * Quick and easy setup
96 | * Add tag via XML layout and/or observer
97 | * Advance Data layer with over 60+ data elements
98 | * Fully customizable with 10 lines of code
99 | * General Data Protection Regulation (GDPR) Support
100 | * GTM Multiple Environments Support
101 | * Content Security Policies Support
102 |
103 | ### Benefits of using Google Tag Manager with Magento
104 | There are a number of benefits to using GTM with Magento:
105 |
106 | - One Centralized Tag Management source - Google tag Manager is one of the tops, and most widely used JavaScript tag
107 | management, therefore, anyone with Google Tag Manager experience will have all the knowledge they need to make edits
108 | to your site.
109 | - Little to No Technically Knowledge - Digital marketer agencies with so tech skills can quickly make and publish
110 | changes to Google Tag Manager without needing to call in developers.
111 | - Version Control - Every change to your Google Tag Manager container is track with a history of who and what was changed.
112 | - Easy to Use - Google Tag Manager is very simple and easy to use. You can easily export your GTM configuration in a
113 | text file that could be saved and reimport.
114 | - Reduce Number of Magento Extensions Needed - Installing individual extensions for AdWords, Facebook tracking,
115 | Snapchat, Microsoft Bing is time-consuming and resource intensive on your Magento store. Using Tag Manager you only
116 | need to install and maintaining one extension.
117 | - Eliminate Themes and Order Success Page Edits - 99% of merchants, developers and agencies don't know or use best
118 | practice when inserting javascript tracking code snippets to a Magento store, and often just add hardcode each
119 | javascript code snippets at random places within the themes files which make it unmaintainable over time as you switch
120 | between different service provider.
121 |
122 | ### How to Customize Google Tag Manager Extension
123 | Need to add more data to your data layer or change existing data to meet your client needs?
124 | Add, changing or removing information from the data layer to meet your client needs is as simple as adding few lines of
125 | php and di.xml code. See our documentation to learn more about
126 | [how to customizing Google Tag Manger](https://www.magepal.com/help/docs/google-tag-manager-for-magento/#api).
127 |
128 |
129 | ### Documentation & Installation Guide
130 |
131 | [How to Installing Google Tag Manager](https://www.magepal.com/help/docs/google-tag-manager-for-magento/#installation)
132 |
133 | [How to setup Google Tag Manager](https://www.magepal.com/help/docs/google-tag-manager-for-magento/#configuration)
134 |
135 | [How to customizing Google Tag Manager](https://www.magepal.com/help/docs/google-tag-manager-for-magento/#api)
136 |
137 | [Google Tag Manger Data Layer attributes](https://www.magepal.com/help/docs/google-tag-manager-for-magento/#datalayer)
138 |
139 | [How to debugging Google Tag Manager](https://www.magepal.com/help/docs/google-tag-manager-for-magento/#debug)
140 |
141 | ### Composer Installation
142 |
143 | ```bash
144 | composer require magepal/magento2-googletagmanager
145 | ```
146 |
147 | ### Data layer attributes
148 |
149 | Our Magento extension provide a vast array of over 60 preconfigure data layer elements to make integrating your Magento store with any third-party service a breeze using Google Tag Manager.
150 |
151 | ### Triggered Events
152 |
153 | ##### Home Page Events
154 | * Events
155 | * homePage**, allPage**, cmsIndexIndexPage**, mpCustomerSession
156 |
157 | ##### Category Page Events
158 | * Events
159 | * productImpression*, categoryPage**, allPage**, catalogCategoryViewPage**, mpCustomerSession
160 | * productClick*, addToCart*, productListSwatchClicked**, productListSwatchSelected**
161 | * view_item_list***, select_item***, add_to_cart***
162 |
163 | ##### Product Detail Page Events
164 | * Events
165 | * productDetail*, productImpression*, productPage**, allPage**, catalogProductViewPage**, mpCustomerSession
166 | * productClick*, addToCart*, removeFromCart*, productDetailSwatchClicked**, productDetailSwatchSelected**, addToCartItemOutOfStock*, addToCartItemOptionRequired*, addToCartItemInvalidQtyIncrements*
167 | * view_item***, select_item***, add_to_cart***, view_item_list***
168 |
169 | ##### Shopping Cart Page Events
170 | * Events
171 | * cartPage**, allPage**, checkoutCartIndexPage**, productImpression*, mpCustomerSession
172 | * productClick*, addToCart*, removeFromCart*
173 | * select_item***, add_to_cart***, remove_from_cart***, view_item_list***
174 |
175 | ##### Checkout Page Events
176 | * Events
177 | * checkoutPage**, allPage**, checkoutIndexIndexPage**, checkout*, checkoutOption*, mpCustomerSession
178 | * checkoutEmailValidation*, shippingMethodAdded*, checkoutShippingStepCompleted*, checkoutShippingStepFailed*, paymentMethodAdded*, checkoutPaymentStepFailed*, checkoutPaymentStepCompleted*
179 | * begin_checkout***, add_shipping_info***, add_payment_info***
180 |
181 | ##### Order Confirmation Page Events
182 | * Events
183 | * purchase*, orderSuccessPage**, allPage**, checkoutOnepageSuccessPage**
184 |
185 | ##### Other Events
186 | * Events
187 | * compareProductAdded**, compareProductRemoved**, wishlistProductAdded**, wishlistProductRemoved**, customerLoginAfter**, customerRegisterAfter**, newsletterSubscriberAdded** newsletterUnsubscribed**
188 |
189 | ### Data Layer Variables
190 |
191 | #### Customer
192 | * Trigger: event equals mpCustomerSession
193 | * customer.isLoggedIn
194 | * customer.id
195 | * customer.groupId
196 | * order.email_sha1**
197 | * order.email**
198 | * order.customer_id**
199 |
200 | #### Product Impression
201 | * Trigger: event equals productImpression
202 | * ecommerce.impressions[].name*
203 | * ecommerce.impressions[].id*
204 | * ecommerce.impressions[].price*
205 | * ecommerce.impressions[].list*
206 | * ecommerce.impressions[].position*
207 | * ecommerce.impressions[].category*
208 |
209 |
210 | #### Category
211 | * Trigger: event equals categoryPage
212 | * category.id
213 | * category.name
214 | * category.path
215 |
216 | #### Search Page
217 | * Trigger: event equals searchPage
218 | * search_term*
219 |
220 | #### Product Detail Page
221 | * Trigger: event equals productPage
222 | * product.id
223 | * product.name
224 | * product.sku
225 | * product.parent_sku
226 | * product.price
227 | * product.product_type
228 | * product.attribute_set_id
229 | * product.path
230 | * product.image_url
231 |
232 | * Trigger: event equals productDetail
233 | * ecommerce.currencyCode*
234 | * ecommerce.products[].id*
235 | * ecommerce.products[].name*
236 | * ecommerce.products[].category*
237 | * ecommerce.products[].price*
238 |
239 | #### Cart
240 | * Trigger: event equals cartPage
241 | * cart.hasItems
242 | * cart.items[].sku
243 | * cart.items[].parent_sku
244 | * cart.items[].product_type
245 | * cart.items[].name
246 | * cart.items[].parent_name
247 | * cart.items[].price
248 | * cart.items[].price_incl_tax
249 | * cart.items[].discount_amount
250 | * cart.items[].tax_amount
251 | * cart.items[].quantity
252 | * cart.total
253 | * cart.itemCount
254 | * cart.itemQty
255 | * cart.hasCoupons
256 | * cart.couponCode
257 |
258 | ##### Add to Cart
259 | * Trigger: event equals addToCart
260 | * ecommerce.add.products[].id*
261 | * ecommerce.add.products[].name*
262 | * ecommerce.add.products[].price*
263 | * ecommerce.add.products[].quantity*
264 | * ecommerce.add.products[].parent_sku*
265 | * ecommerce.add.products[].variant*
266 | * ecommerce.add.products[].category*
267 |
268 | ##### Remove from Cart
269 | * Trigger: event equals removeFromCart
270 | * ecommerce.remove.products[].id*
271 | * ecommerce.remove.products[].name*
272 | * ecommerce.remove.products[].price*
273 | * ecommerce.remove.products[].quantity*
274 | * ecommerce.remove.products[].variant*
275 | * ecommerce.remove.products[].category*
276 |
277 | ### Global Data Layer
278 |
279 | * Trigger: event equals addToCart
280 | * cart.add.products[].id*
281 | * cart.add.products[].name*
282 | * cart.add.products[].price*
283 | * cart.add.products[].quantity*
284 | * cart.add.products[].parent_sku*
285 | * cart.add.products[].variant*
286 | * cart.add.products[].category*
287 |
288 | * Trigger: event equals removeFromCart
289 | * cart.remove.products[].id*
290 | * cart.remove.products[].name*
291 | * cart.remove.products[].price*
292 | * cart.remove.products[].quantity*
293 | * cart.add.products[].parent_sku*
294 | * cart.remove.products[].variant*
295 | * cart.remove.products[].category*
296 |
297 | #### Order
298 | * Trigger: event equals purchase (Google Analytics)
299 | * transactionId
300 | * transactionAffiliation
301 | * transactionTotal
302 | * transactionShipping
303 | * transactionTax
304 | * transactionCouponCode
305 | * transactionDiscount
306 | * transactionSubTotal
307 | * transactionProducts[].sku
308 | * transactionProducts[].parent_sku
309 | * transactionProducts[].product_type
310 | * transactionProducts[].name
311 | * transactionProducts[].price
312 | * transactionProducts[].quantity
313 |
314 | * Additional Order Date (Generic)
315 | * order.order_id
316 | * order.store_name
317 | * order.total
318 | * order.subtotal
319 | * order.shipping
320 | * order.tax
321 | * order.coupon_code
322 | * order.coupon_name
323 | * order.discount
324 | * order.payment_method.title
325 | * order.payment_method.code
326 | * order.shipping_method.title
327 | * order.shipping_method.code
328 | * order.is_virtual
329 | * order.is_guest_checkout
330 | * order.email_sha1**
331 | * order.email**
332 | * order.customer_id**
333 | * order.has_previous_order**
334 | * order.is_first_order**
335 | * order.previous_order_count**
336 | * order.is_new_customer**
337 | * order.items[].sku
338 | * order.items[].id
339 | * order.items[].parent_sku
340 | * order.items[].product_id
341 | * order.items[].name
342 | * order.items[].parent_name
343 | * order.items[].price
344 | * order.items[].price_incl_tax
345 | * order.items[].quantity
346 | * order.items[].subtotal
347 | * order.items[].product_type
348 | * order.items[].discount_amount
349 | * order.items[].discount_percent
350 | * order.items[].tax_amount
351 | * order.items[].is_virtual
352 | * order.items[].variant
353 | * order.items[].categories
354 |
355 | `*` - Data layer provide by our [Enhanced Ecommerce Extension](https://www.magepal.com/enhanced-ecommerce-for-google-tag-manager.html)
356 |
357 | `**` - Data layer provide by our [Data Layer Extension](https://www.magepal.com/magento2/extensions/datalayer-for-google-tag-manager.html)
358 |
359 | `***` - Data layer provide by our [Google Analytics 4 Extension](https://www.magepal.com/google-analytics-4-for-google-tag-manager.html)
360 |
361 | Contribution
362 | ---
363 | Want to contribute to this extension? The quickest way is to open a [pull request on GitHub](https://help.github.com/articles/using-pull-requests).
364 |
365 |
366 | Support
367 | ---
368 | If you encounter any problems or bugs, please open an issue on [GitHub](https://github.com/magepal/magento2-googletagmanager/issues). For fast Premium Support visit our [Google Tag Manager](https://www.magepal.com/magento2/extensions/google-tag-manager.html?utm_source=GTM&utm_medium=Premium%20Support) product page for detail.
369 |
370 | Need help to set up or want to customize our extension to meet your business needs? Please email support@magepal.com and if we like your idea we will add this feature for free or at a discounted rate.
371 |
372 | Magento 2 / Adobe Commerce Extensions
373 | ---
374 |
375 | - [Enhanced E-commerce](https://www.magepal.com/magento2/extensions/enhanced-ecommerce-for-google-tag-manager.html)
376 | - [Enhanced Success Page for Magento 2](https://www.magepal.com/magento2/extensions/enhanced-success-page.html)
377 | - [Enhanced Transactional Emails for Magento 2](https://www.magepal.com/magento2/extensions/enhanced-transactional-emails.html)
378 | - [Google Tag Manager](https://www.magepal.com/magento2/extensions/google-tag-manager.html)
379 | - [Reindex](https://www.magepal.com/magento2/extensions/reindex.html)
380 | - [Custom Shipping Method](https://www.magepal.com/magento2/extensions/custom-shipping-rates-for-magento-2.html)
381 | - [Preview Order Confirmation](https://www.magepal.com/magento2/extensions/preview-order-confirmation-page-for-magento-2.html)
382 | - [Guest to Customer](https://www.magepal.com/magento2/extensions/guest-to-customer.html)
383 | - [Admin Form Fields Manager](https://www.magepal.com/magento2/extensions/admin-form-fields-manager-for-magento-2.html)
384 | - [Customer Dashboard Links Manager](https://www.magepal.com/magento2/extensions/customer-dashboard-links-manager-for-magento-2.html)
385 | - [Lazy Loader](https://www.magepal.com/magento2/extensions/lazy-load.html)
386 | - [Order Confirmation Page Miscellaneous Scripts](https://www.magepal.com/magento2/extensions/order-confirmation-miscellaneous-scripts-for-magento-2.html)
387 | - [HTML Minifier for Magento2](https://www.magepal.com/magento2/extensions/html-minifier.html)
388 | - [Custom SMTP](https://www.magepal.com/magento2/extensions/custom-smtp.html)
389 | - [Catalog Hover Image for Magento](https://www.magepal.com/magento2/extensions/catalog-hover-image-for-magento.html)
390 |
391 | © MagePal LLC. | [www.magepal.com](https://www.magepal.com)
392 |
--------------------------------------------------------------------------------