Download the PHP package ideacrafters/laravel-dittofeed without Composer
On this page you can find all versions of the php package ideacrafters/laravel-dittofeed. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ideacrafters/laravel-dittofeed
More information about ideacrafters/laravel-dittofeed
Files in ideacrafters/laravel-dittofeed
Package laravel-dittofeed
Short Description Laravel SDK for Dittofeed - Open-source customer engagement platform for event tracking, user identification, and marketing automation
License MIT
Homepage https://github.com/ideacrafters/laravel-dittofeed
Informations about the package laravel-dittofeed
Dittofeed Laravel SDK
Laravel SDK for Dittofeed - an open-source customer engagement platform. This package provides a seamless integration with Laravel, enabling you to easily track user events, send targeted emails, and build automated customer journeys.
Features
- ๐ Easy Integration - Install and configure in minutes
- ๐ฏ Event Tracking - Track user actions, page views, and custom events
- ๐ค User Identification - Associate users with traits and attributes
- ๐ Queue Support - Async event processing via Laravel's queue system
- ๐จ Model Traits - Automatic event tracking for Eloquent models
- ๐ Middleware - Automatic page view tracking
- ๐ญ Facade Support - Clean, expressive API using Laravel facades
- ๐งช Testing Utilities - Fake implementation for testing
- ๐ Admin API - Manage templates, segments, and journeys
- ๐ Secure - Built-in authentication and SSL support
Requirements
- PHP 8.0 or higher
- Laravel 9.0, 10.0, or 11.0
Installation
Install the package via Composer:
The package will automatically register itself via Laravel's package auto-discovery.
Configuration
Publish the configuration file:
Add your Dittofeed credentials to your .env file:
Quick Start
Basic Event Tracking
Automatic User Tracking
The SDK automatically resolves the current authenticated user:
Usage Guide
Event Tracking
Identify Users
Associate a user with their traits:
Track Events
Track custom events with properties:
Track Page Views
Track page views (automatically includes URL, referrer, etc.):
Track Screen Views
For mobile applications:
Group Users
Associate users with groups or organizations:
Model Integration
Add the TracksDittofeedEvents trait to your models for automatic event tracking:
Now model events are automatically tracked:
Automatic Page View Tracking
Enable automatic page view tracking by adding the middleware to your app/Http/Kernel.php:
Or register it as a route middleware alias:
Then use it on specific routes:
Automatic Authentication Event Tracking
The SDK automatically tracks user registration, login, and logout events when auto_track.auth_events is enabled in the config (enabled by default).
Events tracked:
User Registered- When a user registersUser Logged In- When a user logs inUser Logged Out- When a user logs out
Queue Support
Enable queue support for asynchronous event processing:
Events will be dispatched to your queue and processed asynchronously.
Batch Operations
Send multiple events in a single request:
Admin API
Access the Admin API for managing templates, segments, and journeys:
Testing
Use the fake implementation in your tests:
Available Assertions
Artisan Commands
Test Your Integration
Sends test events to verify your integration is working correctly.
Flush Event Queue
Manually flush any queued events.
View Configuration
Display your current Dittofeed configuration and status.
Configuration
Environment Variables
| Variable | Description | Default |
|---|---|---|
DITTOFEED_WRITE_KEY |
Your write key for the Public API | - |
DITTOFEED_ADMIN_KEY |
Your admin key for the Admin API | - |
DITTOFEED_HOST |
Dittofeed host URL | https://app.dittofeed.com |
DITTOFEED_WORKSPACE_ID |
Your workspace ID | - |
DITTOFEED_QUEUE_ENABLED |
Enable queue support | false |
DITTOFEED_QUEUE_NAME |
Queue name | default |
DITTOFEED_QUEUE_CONNECTION |
Queue connection | null |
DITTOFEED_TIMEOUT |
HTTP timeout in seconds | 30 |
DITTOFEED_DEBUG |
Enable debug logging | false |
DITTOFEED_TESTING |
Enable testing mode (no events sent) | false |
Auto-Tracking Configuration
Context Enrichment
Automatically enrich events with contextual data:
Advanced Usage
Custom User ID Resolver
Define a custom resolver for the user ID:
Or set it in the config:
Custom Event Properties in Models
Define custom properties for model events:
Manual Custom Events in Models
Best Practices
- Use Queues - Enable queue support for better performance
- Be Selective - Only track events that provide value
- Name Consistently - Use consistent event naming (e.g., "Object Action")
- Include Context - Add relevant properties to events
- Test Thoroughly - Use the fake implementation in tests
- Secure Keys - Never commit API keys to version control
- Monitor Errors - Enable debug mode during development
Security
- Never expose your API keys in client-side code
- Use environment variables for configuration
- Enable SSL verification in production
- Review debug logs for sensitive data
Troubleshooting
Events Not Appearing
- Check your write key is correct
- Verify your host URL is correct
- Enable debug mode to see API responses
- Run
php artisan dittofeed:testto test your integration
Queue Jobs Failing
- Ensure your queue worker is running
- Check queue logs for errors
- Verify network connectivity to Dittofeed
- Increase retry attempts if needed
Performance Issues
- Enable queue support for async processing
- Use batch operations for multiple events
- Disable unnecessary auto-tracking
- Optimize model event tracking
Support
- Documentation: https://docs.dittofeed.com
- Issues: GitHub Issues
- Community: Dittofeed Discord
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
Changelog
Please see CHANGELOG.md for recent changes.
License
The MIT License (MIT). Please see LICENSE for more information.
Credits
Related Packages
- Dittofeed Official SDK - Official Dittofeed platform
- Laravel Pixels Manager - Manage advertising pixels in Laravel
All versions of laravel-dittofeed with dependencies
illuminate/contracts Version ^9.0|^10.0|^11.0|^12.0
guzzlehttp/guzzle Version ^7.0
ramsey/uuid Version ^4.0