Take your Adobe Commerce store to new heights with the power of MagePal extensions. Our expertly crafted code and rigorous testing ensure seamless integration with Adobe Commerce, giving you the freedom to focus on growing your business, not debugging. Upgrade your store's potential with MagePal.
Please Note: The settings below require our Datalayer for Google Tag Manager for Magento and some features also require our Enhanced Ecommerce or Google Analytics 4 extensions.
Segment is a customer data infrastructure (CDI) platform that helps you collect, clean, and control your customer data. Learn more at https://segment.com/docs/spec/ecommerce/v2/#event-lifecycles
Tag Configuration
Tag type : Custom Html
Trigger Configuration
Trigger: searchPage
HTML
<script>
require(['DataLayerSearchApi'], function (DataLayerSearchApi) {
var search = DataLayerSearchApi();
analytics.track('Products Searched', {
query: search.getSearchTerm()
});
});
</script>
Tag Configuration
Tag type : Custom Html
Trigger Configuration
Trigger: categoryPage
HTML
<script>
require(['DataLayerCategoryApi'], function (dataLayerCategoryApi) {
var category = dataLayerCategoryApi();
var segmentProductFormat = {
renameFieldTo: {
p_id: 'product_id',
id: 'sku',
name: 'name',
price: 'price',
position: 'position',
category: 'category',
url: 'url',
image_url: 'image_url'
},
appendIndex: false
};
analytics.track('Product List Viewed', {
list_id: 'category_page',
category: category.getCategory('name'),
products: category.getItems(segmentProductFormat)
});
});
</script>
Tag Configuration
Tag type : Custom Html
Trigger Configuration
Trigger: productClick
HTML
<script>
require(['DataLayerProductApi'], function (dataLayerProductApi) {
var product = dataLayerProductApi();
var renameFieldTo = {
p_id: 'product_id',
id: 'sku',
name: 'name',
price: 'price',
position: 'position',
category: 'category',
url: 'url',
image_url: 'image_url'
};
analytics.track(
'Product Clicked',
product.getProductClickDetail(renameFieldTo)
});
});
</script>
*Enhanced Ecommerce and/or Ga4 extension required for this functionality.
Tag Configuration
Tag type : Custom Html
Trigger Configuration
Trigger: productPage
HTML
<script>
require(['DataLayerProductApi'], function (dataLayerProductApi) {
var product = dataLayerProductApi();
analytics.track('Product Viewed', {
product_id: product.getId(),
sku: product.getSku(),
category: product.getCategory(),
name: product.getName(),
//brand: 'MagePal',
//variant: '200 pieces',
price: product.getPrice(),
//quantity: 1,
//coupon: 'MAYDEALS',
currency: product.getCurrencyCode(),
position: product.getDataItem('list_position', 1),
//value: 18.99,
url: product.getUrl(),
image_url: product.getProduct('image_url')
});
});
</script>
Tag Configuration
Tag type : Custom Html
Trigger Configuration
Trigger: All Custom Events
Event Name : addToCart
HTML
<script>
require(['DataLayerProductApi'], function (dataLayerProductApi) {
var product = dataLayerProductApi();
var segmentProductFormat = {
renameFieldTo: {
p_id: 'product_id',
id: 'sku',
name: 'name',
variant: 'variant',
price: 'price',
quantity: 'quantity',
position: 'position',
category: 'category',
url: 'url',
image_url: 'image_url'
},
appendIndex: false
};
var items = product.getAddedToCartItems(segmentProductFormat);
for (index in items) {
analytics.track('Product Added', items[index]);
}
});
</script>
*Enhanced Ecommerce and/or Ga4 extension required for this functionality.
Tag Configuration
Tag type : Custom Html
Trigger Configuration
Trigger: All Custom Events
Event Name : removeFromCart
HTML
<script>
require(['DataLayerProductApi'], function (dataLayerProductApi) {
var product = dataLayerProductApi();
var segmentProductFormat = {
renameFieldTo: {
p_id: 'product_id',
id: 'sku',
name: 'name',
variant: 'variant',
price: 'price',
quantity: 'quantity',
position: 'position',
category: 'category',
url: 'url',
image_url: 'image_url'
},
appendIndex: false
};
var items = product.getRemovedFromCartItems(segmentProductFormat);
for (index in items) {
analytics.track('Product Removed', items[index]);
}
});
</script>
*Enhanced Ecommerce and/or Ga4 extension required for this functionality.
Total Downloads
years experience with Magento
Magento / Adobe Commerce Extensions
With millions of downloads worldwide, install with confidence knowing that our extensions will just work.
Is your Magento store ready for the future? Say hello to the new Google Analytics 4, which is built from the ground up with all-new features and advanced machine learning technology.
Minification is the process of removing all unnecessary characters and spacing from your source code without changing its functionality.
If your are using Magento + Google Analytics, then you need Enhanced E-commerce for Google Tag Manager.
Add cross-sell, upsell, related products, social media links and other elements to your order confirmation.