Migration Guides
Migrating from Google Analytics
Google Analytics
Mtrix
// Dual tracking example
function trackEvent(gaEventName, gaParams, mtrixEventName, mtrixProps) {
// Google Analytics 4 tracking
gtag('event', gaEventName, gaParams);
// Mtrix tracking
mtrix.trackEvent(mtrixEventName, mtrixProps);
}
// Example usage
function handlePurchase(order) {
trackEvent(
'purchase', // GA4 event name
{
transaction_id: order.id,
value: order.total,
currency: 'USD',
items: order.items.map(item => ({
item_id: item.product.id,
item_name: item.product.name,
price: item.price,
quantity: item.quantity
}))
},
'Purchase', // Mtrix event name
{
orderId: order.id,
total: order.total,
currency: 'USD',
products: order.items.map(item => ({
productId: item.product.id,
productName: item.product.name,
price: item.price,
quantity: item.quantity
}))
}
);
}Migrating from Mixpanel
Last updated
