> For the complete documentation index, see [llms.txt](https://documentation.mtrix.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.mtrix.io/appendix/markdown-1.md).

# Migration Guides

#### Migrating from Google Analytics

If you're transitioning from Google Analytics to Mtrix, follow this guide for a smooth migration.

**Event Mapping**

| Google Analytics | Mtrix           |
| ---------------- | --------------- |
| `page_view`      | `PageView`      |
| `click`          | `Click`         |
| `scroll`         | `Scroll`        |
| `video_start`    | `VideoStart`    |
| `file_download`  | `FileDownload`  |
| `purchase`       | `Purchase`      |
| `add_to_cart`    | `AddToCart`     |
| `begin_checkout` | `BeginCheckout` |
| `view_item`      | `ProductViewed` |
| `sign_up`        | `Signup`        |
| `login`          | `Login`         |
| `search`         | `Search`        |

**Implementation Steps**

1. **Run in parallel**: Initially implement Mtrix alongside Google Analytics to validate data consistency.

```javascript
// 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
      }))
    }
  );
}
```

2. **Create a data dictionary**: Document all events and properties to ensure consistency during the migration.
3. **Update data layer integrations**: Modify any data layer implementations to support Mtrix.
4. **Recreate custom reports**: Build equivalent reports in Mtrix for your GA custom reports.
5. **Validate data**: Compare key metrics between platforms during the parallel tracking period.

**Timeline Recommendation**

* Week 1-2: Set up Mtrix and implement basic tracking
* Week 3-4: Run both systems in parallel
* Week 5-6: Validate data and address discrepancies
* Week 7-8: Migrate custom reports and dashboards
* Week 9-10: Train team on Mtrix platform
* Week 11-12: Complete transition and phase out GA

#### Migrating from Mixpanel

If you're moving from Mixpanel to Mtrix, follow these steps to ensure continuity.

**Implementation Code**

```javascript
// Mixpanel
mixpanel.track("Purchased Item", {
  "Product ID": "12345",
  "Product Name": "Premium Subscription",
  "Price": 99.99,
  "Currency": "USD"
});

// Mtrix
mtrix.trackEvent("PurchasedItem", {
  productId: "12345",
  productName: "Premium Subscription",
  price: 99.99,
  currency: "USD"
});
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.mtrix.io/appendix/markdown-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
