Pick the snippet that matches your stack.
React Native
import { TriplePixel } from '@triplewhale/react-native-triple-pixel';
// Once at app startup
TriplePixel.init('your-shop', 'US', 'USD');
// Screen view
TriplePixel.pageView('/home');
// Product page
TriplePixel.pageViewWithProduct('/products/42', '42', 'T-Shirt', '29.99');
// Add to cart
TriplePixel.addToCart('42', '', 29.99, 1);
// Contact capture
TriplePixel.contact('[email protected]');
// Purchase
TriplePixel.purchase({
email: '[email protected]',
lineItems: [{ id: '42', quantity: 1, variant: '', price: 29.99 }],
orderId: '1001',
token: 'abc123',
});Android (Kotlin)
import com.triplewhale.pixel.TriplePixel
import com.triplewhale.pixel.PageLoadEvent
// Once at app startup, e.g. in Application.onCreate
TriplePixel.init(
shopName = "your-shop",
msCountry = "US",
curr = "USD",
)
TriplePixel.pageLoad(PageLoadEvent(url = "/home"))iOS (Swift)
import TriplePixelSDK
// Once at app startup, e.g. in AppDelegate / @main App init
TriplePixel.Companion.shared.doInit(
shopName: "your-shop",
msCountry: "US",
curr: "USD"
)
TriplePixel.Companion.shared.pageLoad(
e: PageLoadEvent(
url: "/home",
productId: nil,
productName: nil,
productPrice: nil,
productVariant: nil,
searchTerm: nil,
collection: nil
)
)init parameters
init parameters| Parameter | Type | Description |
|---|---|---|
shopName | string | Your Shopify store identifier. |
msCountry | string | Country code for attribution, e.g. "US", "IL". |
curr | string | Currency code, e.g. "USD", "ILS". |
init should be called once at app startup, before any tracking method. Calls made before init short-circuit silently; no events will be sent.
Verify it's working
After calling init and pageView, look for [TriplePixel] log lines in the platform-appropriate console:
- React Native — Metro console.
- iOS — Xcode console.
- Android — Logcat, filtered by the
TriplePixeltag (or runadb logcat -s TriplePixel:*).
If you see native module not available instead, see Troubleshooting.