Mivamerchant Analytics Integrations: Setup Guide | OpsBlu Docs

Mivamerchant Analytics Integrations: Setup Guide

Integrate GA4, GTM, and Meta Pixel with Miva Merchant using page templates, custom fields, and the Miva template language.

Miva Merchant is a proprietary ecommerce platform with its own template language (MVT/MVTE), a powerful but complex template system, and full checkout customization. Unlike Shopify or BigCommerce, Miva gives merchants direct access to every page template including checkout, making it possible to implement comprehensive ecommerce tracking.

Integration Architecture

Miva Merchant provides three integration paths:

  1. Page Templates (MVTE) -- Miva's template language (MVTE - Miva Template Engine) controls all frontend output. Edit templates at Admin > User Interface > Pages or via the Miva template editor. Templates use <mvt:*> tags for server-side logic and data injection.
  2. Custom Fields -- Miva's custom field system allows admin-editable values that can be referenced in templates. Store GTM container IDs or tracking configuration in custom fields for non-developer management.
  3. Modules -- Miva's module system extends functionality. Some analytics modules are available through the Miva App Store, though manual template integration is more common for GA4.

Available Integrations

Analytics Platforms

Google Analytics 4

  • MVTE template injection with full ecommerce data layer
  • GTM-based GA4 (recommended)
  • Miva App Store analytics modules

Tag Management

Google Tag Manager

  • Global header/footer templates
  • Page-specific MVTE injection for ecommerce events

Marketing Pixels

Meta Pixel

  • Via GTM container (recommended)
  • MVTE template head injection
  • Conversions API via Miva's webhook/module system

MVTE Template Integration

Add GTM and a comprehensive ecommerce data layer using Miva's template variables. In the global header template (Admin > User Interface > Global Header):

<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;
j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl;
f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-XXXX');</script>

<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
  'pageType': '<mvt:if expr="l.settings:page:code EQ 'PROD'">product<mvt:elseif expr="l.settings:page:code EQ 'CTGY'">category<mvt:elseif expr="l.settings:page:code EQ 'BASK'">cart<mvt:elseif expr="l.settings:page:code EQ 'OINF' OR l.settings:page:code EQ 'OPAY'">checkout<mvt:elseif expr="l.settings:page:code EQ 'INVC'">purchase<mvt:else>other</mvt:if>',
  'storeCode': '&mvt:store:code;',
  'storeName': '&mvt:store:name;',
  'currency': '&mvt:store:currncy_code;'
});
</script>

On the product page (PROD template), add a view_item event:

<mvt:if expr="l.settings:page:code EQ 'PROD'">
<script>
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
  event: 'view_item',
  ecommerce: {
    currency: '&mvt:store:currncy_code;',
    value: &mvt:product:price;,
    items: [{
      item_id: '&mvt:product:code;',
      item_name: '&mvt:product:name;',
      item_category: '&mvt:product:category;',
      price: &mvt:product:price;,
      quantity: 1
    }]
  }
});
</script>
</mvt:if>

Platform Limitations

MVTE learning curve. Miva's template language (<mvt:*> tags) is proprietary and significantly different from other templating systems. The syntax for conditionals (<mvt:if expr="...">), assignments (<mvt:assign>), and loops (<mvt:foreach>) requires Miva-specific knowledge.

Template encoding. MVTE entity references (&mvt:product:name;) output HTML-encoded values by default. For JavaScript contexts (data layer values), use &mvte:product:name; (the MVTE-encoded variant) to get properly escaped output.

Module system is proprietary. Miva modules are compiled binaries (not open-source PHP/JS). Creating custom analytics modules requires Miva's Module SDK and cannot be inspected or modified by end users.

Caching. Miva's page caching can serve stale data layer values. Ensure ecommerce-critical pages (cart, checkout, order confirmation) are excluded from page caching or use client-side data layer population.

Order confirmation data. The order confirmation page (INVC template) has access to order data via l.settings:order:* variables, but only during the initial page load after purchase. Refreshing the page may not provide order data, leading to missing purchase events on page reloads.

Performance Considerations

  • Template rendering. Miva's MVTE engine processes templates server-side. Complex data layer logic with nested <mvt:foreach> loops (for category breadcrumbs, product attributes) adds to server response time.
  • Single-page vs multi-page checkout. Miva supports both single-page and multi-step checkout flows. GTM triggers must account for the checkout configuration your store uses.
  • Module script overhead. Miva modules can inject their own JavaScript. Audit active modules at Admin > Modules to identify redundant analytics modules that could be consolidated through GTM.
  1. Add GTM to global header template -- Single container for all pages
  2. Build page-type-aware data layer -- Use Miva page codes (PROD, CTGY, BASK, OINF, INVC) for context
  3. Implement ecommerce data layer -- view_item, add_to_cart, begin_checkout, purchase events
  4. Configure GA4 via GTM -- Map Miva product data to GA4 ecommerce events
  5. Add Meta Pixel via GTM -- Map ecommerce events to Meta standard events

Next Steps

For general integration concepts, see the integrations overview.