Apps and Integrations
Extend your store with apps and third-party integrations, and connect DoingHub, Doing Studio, and Doing.ye
Apps and Integrations
Extend your doin9 store's functionality with apps and integrations. Connect with popular services and tools to streamline your operations, and learn how to integrate the core doin9 platform components: DoingHub, Doing Studio, and Doing.ye.
Platform Integration Overview
The doin9 ecosystem consists of three core components that work together to provide a complete e-commerce solution:
DoingHub (Backend Engine)
Doing Studio (Visual Builder)
Doing.ye (Analytics Platform)
Core Platform Integrations
DoingHub ↔ Doing Studio Integration
#### Automatic Data Synchronization
Doing Studio automatically connects to your DoingHub backend to access:
#### Configuration Steps
1. Connect Doing Studio to DoingHub
```javascript
// Doing Studio configuration
{
"doinghub_endpoint": "https://api.yourstore.com",
"api_key": "your_doinghub_api_key",
"store_id": "your_store_id",
"sync_interval": 300 // seconds
}
```
2. Enable Real-time Updates
```javascript
// WebSocket connection for real-time updates
const doingHubSocket = new WebSocket('wss://api.yourstore.com/ws');
doingHubSocket.onmessage = (event) => {
const update = JSON.parse(event.data);
if (update.type === 'product_update') {
updateProductDisplay(update.data);
}
};
```
DoingHub ↔ Doing.ye Integration
#### Analytics Data Flow
DoingHub automatically sends e-commerce events to Doing.ye:
#### Server-Side Tracking Setup
```php
// DoingHub server-side tracking
use DoingYe\Analytics\Client;
$analytics = new Client([
'tracking_id' => 'YOUR_DOING_YE_TRACKING_ID',
'api_endpoint' => 'https://analytics.doin9.com/collect'
]);
// Track order completion
$analytics->track('purchase', [
'transaction_id' => $order->id,
'value' => $order->total,
'currency' => $order->currency,
'items' => $order->items->map(function($item) {
return [
'item_id' => $item->product_id,
'item_name' => $item->product_name,
'category' => $item->category,
'quantity' => $item->quantity,
'price' => $item->price
];
})->toArray()
]);
```
Doing Studio ↔ Doing.ye Integration
#### Frontend Analytics Integration
Doing Studio pages automatically include Doing.ye tracking:
```javascript
// Automatic tracking in Doing Studio pages
import { DoingYeTracker } from '@doing-studio/analytics';
const tracker = new DoingYeTracker({
trackingId: process.env.DOING_YE_TRACKING_ID,
autoTrack: {
pageViews: true,
clicks: true,
formSubmissions: true,
scrollDepth: true
}
});
// Track custom events
tracker.track('product_view', {
product_id: product.id,
product_name: product.name,
category: product.category,
price: product.price
});
```
#### A/B Testing Integration
```javascript
// A/B testing with Doing Studio and Doing.ye
import { ABTest } from '@doing-studio/experiments';
const abTest = new ABTest({
experimentId: 'homepage_hero_test',
variants: ['control', 'variant_a', 'variant_b'],
analytics: tracker
});
// Show variant and track exposure
const variant = abTest.getVariant();
tracker.track('experiment_exposure', {
experiment_id: 'homepage_hero_test',
variant: variant
});
```
Third-Party App Integrations
E-commerce Apps
#### Accounting Integration
QuickBooks Online
```javascript
// QuickBooks integration configuration
{
"app": "quickbooks",
"credentials": {
"client_id": "your_qb_client_id",
"client_secret": "your_qb_client_secret",
"sandbox": false
},
"sync_settings": {
"customers": true,
"products": true,
"orders": true,
"payments": true,
"sync_frequency": "daily"
}
}
```
Xero Integration
```javascript
// Xero integration setup
{
"app": "xero",
"credentials": {
"client_id": "your_xero_client_id",
"client_secret": "your_xero_client_secret"
},
"mapping": {
"revenue_account": "4000",
"tax_account": "2200",
"shipping_account": "4100"
}
}
```
#### Marketing Automation
Mailchimp Integration
```javascript
// Mailchimp setup
{
"app": "mailchimp",
"api_key": "your_mailchimp_api_key",
"lists": {
"customers": "list_id_1",
"newsletter": "list_id_2",
"abandoned_cart": "list_id_3"
},
"automation": {
"welcome_series": true,
"abandoned_cart": true,
"post_purchase": true
}
}
```
Klaviyo Integration
```javascript
// Klaviyo configuration
{
"app": "klaviyo",
"public_key": "your_klaviyo_public_key",
"private_key": "your_klaviyo_private_key",
"tracking": {
"identify_customers": true,
"track_events": true,
"sync_profiles": true
}
}
```
Shipping and Fulfillment
#### ShipStation Integration
```javascript
// ShipStation setup
{
"app": "shipstation",
"credentials": {
"api_key": "your_shipstation_api_key",
"api_secret": "your_shipstation_secret"
},
"settings": {
"auto_import_orders": true,
"update_tracking": true,
"default_service": "usps_priority_mail"
}
}
```
#### Easyship Integration
```javascript
// Easyship configuration
{
"app": "easyship",
"access_token": "your_easyship_token",
"settings": {
"auto_rate_calculation": true,
"insurance_options": true,
"signature_confirmation": false
}
}
```
Analytics and Marketing
#### Google Analytics 4 Integration
```javascript
// GA4 integration alongside Doing.ye
{
"app": "google_analytics_4",
"measurement_id": "G-XXXXXXXXXX",
"enhanced_ecommerce": true,
"cross_domain_tracking": true,
"data_sharing": {
"doing_ye": true, // Share data with Doing.ye
"attribution_modeling": true
}
}
```
#### Facebook Pixel Integration
```javascript
// Facebook Pixel setup
{
"app": "facebook_pixel",
"pixel_id": "your_facebook_pixel_id",
"events": {
"page_view": true,
"view_content": true,
"add_to_cart": true,
"initiate_checkout": true,
"purchase": true
},
"conversions_api": {
"enabled": true,
"access_token": "your_fb_access_token"
}
}
```
Custom Integration Development
API-Based Integrations
#### DoingHub API Integration
```javascript
// Custom app integration with DoingHub
class CustomAppIntegration {
constructor(config) {
this.apiKey = config.apiKey;
this.endpoint = config.endpoint;
this.storeId = config.storeId;
}
async syncProducts() {
const response = await fetch(`${this.endpoint}/products`, {
headers: {
'Authorization': `Bearer ${this.apiKey}`,
'X-Store-ID': this.storeId
}
});
const products = await response.json();
return this.processProducts(products);
}
async createWebhook(event, url) {
return fetch(`${this.endpoint}/webhooks`, {
method: 'POST',
headers: {
'Authorization': `Bearer ${this.apiKey}`,
'Content-Type': 'application/json'
},
body: JSON.stringify({
event: event,
url: url,
active: true
})
});
}
}
```
#### Webhook Integration
```javascript
// Webhook handler for real-time updates
app.post('/webhooks/doinghub', (req, res) => {
const event = req.body;
switch(event.type) {
case 'order.created':
handleNewOrder(event.data);
break;
case 'product.updated':
syncProductUpdate(event.data);
break;
case 'inventory.low':
sendLowStockAlert(event.data);
break;
}
res.status(200).send('OK');
});
```
Doing Studio Plugin Development
#### Custom Component Integration
```jsx
// Custom Doing Studio component
import React from 'react';
import { DoingStudioComponent } from '@doing-studio/core';
class CustomReviewsWidget extends DoingStudioComponent {
static config = {
name: 'Product Reviews',
category: 'ecommerce',
props: {
productId: { type: 'string', required: true },
maxReviews: { type: 'number', default: 5 },
showRating: { type: 'boolean', default: true }
}
};
async fetchReviews() {
const response = await this.doingHubAPI.get(`/products/${this.props.productId}/reviews`);
return response.data;
}
render() {
return (
{/* Review display logic */}
);
}
}
export default CustomReviewsWidget;
```
Doing.ye Custom Analytics
#### Custom Event Tracking
```javascript
// Custom analytics events for specific business needs
class CustomAnalytics {
constructor(doingYeTracker) {
this.tracker = doingYeTracker;
}
trackProductComparison(products) {
this.tracker.track('product_comparison', {
products: products.map(p => p.id),
comparison_type: 'side_by_side',
product_count: products.length
});
}
trackWishlistAction(action, product) {
this.tracker.track('wishlist_action', {
action: action, // 'add', 'remove', 'view'
product_id: product.id,
product_category: product.category,
product_price: product.price
});
}
trackCustomerSupport(interaction) {
this.tracker.track('customer_support', {
interaction_type: interaction.type,
resolution_time: interaction.duration,
satisfaction_score: interaction.rating,
issue_category: interaction.category
});
}
}
```
Integration Best Practices
Security Considerations
#### API Key Management
#### Data Privacy
Performance Optimization
#### Efficient Data Sync
```javascript
// Optimized sync strategy
class OptimizedSync {
constructor() {
this.lastSyncTime = this.getLastSyncTime();
this.batchSize = 100;
}
async syncIncrementalChanges() {
const changes = await this.getChangesSince(this.lastSyncTime);
// Process in batches to avoid overwhelming APIs
for (let i = 0; i < changes.length; i += this.batchSize) {
const batch = changes.slice(i, i + this.batchSize);
await this.processBatch(batch);
// Add delay between batches to respect rate limits
await this.delay(1000);
}
this.updateLastSyncTime();
}
delay(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
}
```
#### Rate Limiting
```javascript
// Rate limiting implementation
class RateLimiter {
constructor(requestsPerSecond = 10) {
this.requestsPerSecond = requestsPerSecond;
this.requests = [];
}
async makeRequest(requestFn) {
const now = Date.now();
// Remove requests older than 1 second
this.requests = this.requests.filter(time => now - time < 1000);
// Wait if we've hit the rate limit
if (this.requests.length >= this.requestsPerSecond) {
const oldestRequest = Math.min(...this.requests);
const waitTime = 1000 - (now - oldestRequest);
await new Promise(resolve => setTimeout(resolve, waitTime));
}
this.requests.push(now);
return requestFn();
}
}
```
Error Handling and Monitoring
#### Robust Error Handling
```javascript
// Comprehensive error handling
class IntegrationManager {
async executeWithRetry(operation, maxRetries = 3) {
for (let attempt = 1; attempt <= maxRetries; attempt++) {
try {
return await operation();
} catch (error) {
if (attempt === maxRetries) {
this.logError(error, { operation: operation.name, attempt });
throw error;
}
// Exponential backoff
const delay = Math.pow(2, attempt) * 1000;
await new Promise(resolve => setTimeout(resolve, delay));
}
}
}
logError(error, context) {
console.error('Integration Error:', {
message: error.message,
stack: error.stack,
context: context,
timestamp: new Date().toISOString()
});
// Send to monitoring service
this.sendToMonitoring(error, context);
}
}
```
Troubleshooting Common Integration Issues
Authentication Problems
1. Invalid API Keys: Verify API keys are correct and active
2. Expired Tokens: Implement token refresh mechanisms
3. Permission Issues: Check API permissions and scopes
4. Rate Limiting: Implement proper rate limiting and backoff
Data Synchronization Issues
1. Mapping Errors: Verify field mappings between systems
2. Data Format Mismatches: Ensure data formats are compatible
3. Timing Issues: Handle timezone differences properly
4. Duplicate Data: Implement deduplication logic
Performance Issues
1. Slow API Responses: Optimize API calls and implement caching
2. Memory Usage: Monitor and optimize memory consumption
3. Database Performance: Optimize database queries and indexes
4. Network Latency: Implement connection pooling and retries