Migration Guide

Switch from other payment analytics platforms to SubLoop with ease.

Migrating from RevenueCat

If you're currently using RevenueCat, here's how to migrate to SubLoop:

1. Data Export

Export your historical data from RevenueCat and import it into SubLoop using our migration API:

// PHP example for bulk import
$subloop = new SubLoop('sk_your_api_key_here');

foreach ($revenueCatData as $transaction) {
    $subloop->payments->create([
        'customer_id' => $transaction['subscriber_id'],
        'subscription_id' => $transaction['product_id'],
        'amount' => $transaction['revenue'],
        'currency' => $transaction['currency'],
        'status' => $transaction['is_successful'] ? 'succeeded' : 'failed',
        'payment_date' => $transaction['purchase_date'],
        'metadata' => [
            'migrated_from' => 'revenuecat',
            'original_transaction_id' => $transaction['transaction_id']
        ]
    ]);
}

2. SDK Replacement

Replace RevenueCat SDK calls with SubLoop equivalents:

Before (RevenueCat):

// RevenueCat
Purchases.logIn(customerID);
Purchases.purchaseProduct(product);

After (SubLoop):

// SubLoop - track after your existing payment flow
const subloop = new SubLoop('sk_your_api_key');
await subloop.payments.createSuccessful(customerID, amount, currency, subscriptionId);

Migrating from Stripe Analytics

Moving from Stripe's built-in analytics to SubLoop provides more detailed insights:

Webhook Integration

Update your Stripe webhooks to also send data to SubLoop:

// In your Stripe webhook handler
if ($event->type === 'payment_intent.succeeded') {
    $paymentIntent = $event->data->object;
    
    // Your existing Stripe logic
    // ...
    
    // Add SubLoop tracking
    $subloop->payments->createSuccessful(
        customerId: $paymentIntent->customer,
        amount: $paymentIntent->amount_received / 100,
        currency: strtoupper($paymentIntent->currency),
        subscriptionId: $paymentIntent->metadata->subscription_id ?? null
    );
}

Migrating from Custom Analytics

If you've built your own payment analytics, SubLoop can replace your custom solution:

Database Migration

Export your payment data and import it into SubLoop:

-- Export your existing payment data
SELECT 
    customer_id,
    subscription_id,
    amount,
    currency,
    status,
    created_at as payment_date
FROM your_payments_table
WHERE created_at >= '2024-01-01';

Replace Custom Queries

Replace your custom analytics queries with SubLoop API calls:

Before (Custom SQL):

SELECT 
    SUM(amount) as mrr 
FROM payments 
WHERE status = 'succeeded' 
    AND subscription_id IS NOT NULL
    AND DATE_TRUNC('month', created_at) = DATE_TRUNC('month', CURRENT_DATE);

After (SubLoop API):

$mrr = $subloop->analytics->getMRR();
echo "Current MRR: $" . $mrr['mrr'];

Migration Checklist

📋 Pre-Migration

  • ☐ Export historical payment data
  • ☐ Set up SubLoop account and get API key
  • ☐ Install SubLoop SDK
  • ☐ Test integration in development environment

🚀 Migration

  • ☐ Import historical data to SubLoop
  • ☐ Update payment tracking code
  • ☐ Replace analytics queries with SubLoop API calls
  • ☐ Update dashboards and reports
  • ☐ Test all integrations

✅ Post-Migration

  • ☐ Verify data accuracy
  • ☐ Monitor for any issues
  • ☐ Train team on new SubLoop dashboard
  • ☐ Remove old analytics code
  • ☐ Cancel previous analytics subscriptions

Need Help?

Our migration team is here to help make your transition smooth: