Razorpay Setup
Connect Razorpay through guided webhook setup for confidence-based revenue attribution. The Manual Payment API remains the recommended self-serve fallback for private launch.
How the integration works
When a customer completes a payment on Razorpay, Razorpay sends a webhook event to Metrivo. Our server verifies the request using HMAC-SHA256 signature validation, extracts the customer email and payment details, and matches them to the visitor's session. The revenue is then attributed to the traffic source, landing page, and campaign of that session.
For the best attribution accuracy, pass the Metrivo visitor and session IDs in the Razorpay payment's notes field. This gives Metrivo high-confidence attribution even for anonymous visitors.
Setup steps
Ask Metrivo to create the integration
For private launch, Metrivo support creates the Razorpay payment integration row for your website and gives you a webhook URL like: https://metrivo.co/api/integrations/razorpay/webhook/YOUR_INTEGRATION_ID
Add the webhook in your Razorpay Dashboard
Log in to your Razorpay Dashboard and go to Settings → Webhooks → Add New Webhook. Paste the Metrivo webhook URL. Set a strong secret key and share it through the concierge setup path.
Select the webhook events to enable
In the Razorpay webhook configuration, enable the following events: payment.captured, order.paid, subscription.charged, and subscription.activated. Save the webhook.
Metrivo stores the webhook secret
Metrivo support stores the webhook secret in the integration config. Metrivo will verify every incoming webhook using HMAC-SHA256.
Test with a real transaction
Make a test purchase on your site (you can refund it immediately). Metrivo support confirms the payment appears with an attribution confidence label.
Supported webhook events
Passing tracking IDs for high-confidence attribution
To get precise, session-level attribution, add the Metrivo visitor and session IDs to the Razorpay payment's notes field when creating the order or payment link on your server:
Retrieve the IDs from the browser using the Metrivo tracking script: window.Metrivo.getVisitorId(). Pass them to your server when the customer initiates checkout.