For general GA4 ecommerce concepts, see Google Analytics Ecommerce
Ecommerce Tracking Applicability
SharePoint is primarily a content management system, not an e-commerce platform. GA4 ecommerce tracking (view_item, add_to_cart, purchase, etc.) only applies if you've added e-commerce functionality to your SharePoint site through a third-party integration or custom development.
If You Have E-commerce on Your Site
If you've integrated a shopping cart or payment system, implement the standard GA4 ecommerce events by pushing them to the data layer:
Product View
dataLayer.push({ ecommerce: null }); // Clear previous data
dataLayer.push({
'event': 'view_item',
'ecommerce': {
'currency': 'USD',
'value': 29.99,
'items': [{
'item_id': 'SKU-123',
'item_name': 'Product Name',
'item_category': 'Category',
'price': 29.99,
'quantity': 1
}]
}
});
Add to Cart
dataLayer.push({ ecommerce: null });
dataLayer.push({
'event': 'add_to_cart',
'ecommerce': {
'currency': 'USD',
'value': 29.99,
'items': [{
'item_id': 'SKU-123',
'item_name': 'Product Name',
'price': 29.99,
'quantity': 1
}]
}
});
Purchase
dataLayer.push({ ecommerce: null });
dataLayer.push({
'event': 'purchase',
'ecommerce': {
'transaction_id': 'ORDER-456',
'value': 59.98,
'tax': 5.00,
'shipping': 4.99,
'currency': 'USD',
'items': [{
'item_id': 'SKU-123',
'item_name': 'Product Name',
'price': 29.99,
'quantity': 2
}]
}
});
Important: Always push { ecommerce: null } before each ecommerce event to prevent stale data from a previous event leaking into the next one.
Full Ecommerce Event Reference
| Event | Funnel Stage | When to Fire |
|---|---|---|
view_item_list |
Discovery | Category/search results page |
select_item |
Discovery | Click on a product in a list |
view_item |
Consideration | Product detail page |
add_to_cart |
Intent | Add to cart action |
remove_from_cart |
Intent | Remove from cart action |
view_cart |
Intent | Cart page view |
begin_checkout |
Conversion | Checkout page load |
add_shipping_info |
Conversion | Shipping step completed |
add_payment_info |
Conversion | Payment step completed |
purchase |
Conversion | Order confirmation |
refund |
Post-purchase | Order refunded |
GTM Configuration
In GTM, create a GA4 Event tag for each ecommerce event:
- Tag Type: Google Analytics: GA4 Event
- Event Name: Use the built-in
{{Event}}variable (it automatically reads theeventkey from data layer pushes) - Ecommerce: Check Send Ecommerce data → Data source: Data Layer
- Trigger: Custom Event matching each event name (
view_item,add_to_cart,purchase, etc.)
For Non-Ecommerce Sites
If your SharePoint site doesn't sell products, focus on standard event tracking instead — form submissions, CTA clicks, and content engagement events will be more relevant.
Next Steps
- GA4 Event Tracking — non-ecommerce custom events
- Data Layer Setup — configure the data layer for ecommerce
- Events Not Firing — troubleshoot missing events