Download the PHP package marshmallow/marketing-data-tracker without Composer

On this page you can find all versions of the php package marshmallow/marketing-data-tracker. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package marketing-data-tracker

๐ŸŽฏ Laravel Marketing Data Tracker

Comprehensive Marketing Attribution & UTM Parameter Tracking for Laravel

Latest Version on Packagist GitHub Code Style Action Status Total Downloads

Track, store, and analyze marketing attribution data from Google Ads, Facebook, TikTok, LinkedIn, and 10+ other advertising platforms in your Laravel application. Automatically capture UTM parameters, click IDs, and conversion data to understand your marketing performance and ROI.

Perfect for e-commerce sites, SaaS applications, and any Laravel project that needs comprehensive marketing attribution tracking.


โœจ Features

๐Ÿš€ Multi-Platform Support - Google Ads, Facebook/Meta, TikTok, LinkedIn, Twitter, Pinterest, Microsoft Ads, Reddit, Snapchat, and more

๐ŸŽฏ Intelligent Click ID Tracking - Automatically detect and prioritize gclid, fbclid, ttclid, msclkid, and other platform-specific identifiers

๐Ÿ“Š UTM Parameter Management - Complete UTM tracking with automatic parameter extraction and storage

๐Ÿ”„ Conversion Attribution - Link conversions back to their original marketing source with full attribution data

๐Ÿช Advanced Cookie Support - Track 60+ marketing cookies across all major advertising platforms

โšก Zero Configuration - Works out of the box with sensible defaults, fully customizable

๐Ÿ›ก๏ธ Privacy Compliant - Built-in GDPR support with consent management and data export

๐Ÿ“ฑ Mobile Attribution - iOS 14.5+ support with gbraid and wbraid tracking

๐ŸŽจ Laravel Nova Integration - Beautiful admin interface for viewing marketing data


๐Ÿš€ Quick Start

Installation

Install via Composer:

Publish and run migrations:

Basic Setup

1. Add the trait to your models:

2. Add the middleware to your web routes:

On Laravel 11+ register it in bootstrap/app.php:

On Laravel 10, add it to the web group in app/Http/Kernel.php:

3. Track marketing data on user registration:

That's it! ๐ŸŽ‰ The package will now automatically track marketing parameters from all major advertising platforms.


๐Ÿ“– Platform Support

Enhanced Multi-Platform System

The package now features a comprehensive platform management system supporting 12+ advertising platforms with configurable parameters, cookies, and tracking templates.

Supported Advertising Platforms

Platform Click ID UTM Source Custom Parameters Status
Google Ads gclid, gbraid, wbraid google 20+ ValueTrack parameters โœ… Enhanced
Meta/Facebook fbclid facebook, meta Dynamic campaign parameters โœ… Enhanced
Microsoft Ads msclkid bing, microsoft UET tracking parameters โœ… Enhanced
LinkedIn Ads li_fat_id linkedin Professional network parameters โœ… Enhanced
Twitter/X Ads twclid twitter, x Social media parameters โœ… Enhanced
Pinterest Ads epik pinterest Visual platform parameters โœ… Enhanced
TikTok Ads ttclid tiktok Short-form video parameters โœ… Enhanced
Reddit Ads rdt_cid reddit Community platform parameters โœ… Enhanced
Snapchat Ads sscid snapchat Mobile-first parameters โœ… Enhanced
Amazon DSP maas amazon E-commerce advertising โœ… Enhanced
TradeTracker ttid tradetracker Affiliate network tracking โœ… New
Email Marketing mc_cid, mc_eid email Campaign tracking โœ… New

Platform Configuration

Each platform can be individually enabled/disabled and configured:

Automatic Parameter Detection

The package automatically detects and stores 175+ marketing parameters:


๐ŸŽฏ Usage Examples

Basic Marketing Attribution

Advanced Click ID Management

The package now features priority-based click ID detection with configurable extraction and cookie support:

Click ID Priority Configuration

E-commerce Conversion Tracking

Enhanced e-commerce tracking with Google Tag Manager format and multiple platform support:

E-commerce Configuration

Campaign Performance Analysis


โš™๏ธ Configuration

Publish the configuration file:

Platform-Specific Configuration

Cookie Consent Management

Consent handling lives under the cookie_management key, which also groups cookies into analytics, advertising, and functional buckets:

When auto_register_exceptions is enabled (the default), the package automatically adds all configured marketing cookies to Laravel's EncryptCookies exceptions so they can be read in plain text.


๐Ÿ”ง Advanced Features

Marketing URL Builder

NEW: Fluent URL builder with platform-specific templates and ValueTrack parameter support:

URL Builder Features

Event-Driven Architecture

NEW: Comprehensive event system for marketing data lifecycle tracking:

Event Configuration

Laravel Nova Integration


๐ŸŽจ Platform-Specific Setup

Google Ads Configuration

Add to your Google Ads account-level tracking template:

Facebook Ads Configuration

Use Facebook's URL parameters in your ads:

Server-Side Tracking Setup

For accurate attribution, configure server-side tracking:


๐Ÿ—๏ธ Architecture

Database Schema

The package creates a flexible marketing data storage system:

Privacy & GDPR Compliance


๐Ÿ“Š Analytics Integration

Google Analytics 4

Facebook Conversions API

Forward conversions to the Facebook Conversions API by listening for the ConversionTracked event and using the attribution data it carries:

Custom Analytics Platforms


๐Ÿงช Testing

Testing Marketing Attribution


๐Ÿš€ Performance


๐Ÿ› ๏ธ New Advanced Features

Automatic Model Observation

NEW: Automatic UTM data capture and click ID detection:

Cookie Management System

NEW: Advanced cookie tracking with consent management:

Platform Management Service

NEW: Centralized platform configuration management:


๐Ÿ“š API Reference

Enhanced HasMarketingParameters Trait

Method Description Example
setUtmSourceData() Capture marketing parameters $user->setUtmSourceData()
getPrimaryGoogleClickId() NEW: Get Google click ID with priority $user->getPrimaryGoogleClickId()
primary_click_id Get highest priority click ID $user->primary_click_id
platform_name Get platform name $user->platform_name
detectPlatformFromMarketingData() Detect advertising platform $user->detectPlatformFromMarketingData()
marketing_parameter_list Get formatted parameters $user->marketing_parameter_list

MarketingUrlBuilder

Method Description Example
googleAds() Build Google Ads URL MarketingUrlBuilder::googleAds($url, $campaign)
metaAds() Build Facebook Ads URL MarketingUrlBuilder::metaAds($url, $campaign)
microsoftAds() NEW: Build Microsoft Ads URL MarketingUrlBuilder::microsoftAds($url, $campaign)
linkedInAds() NEW: Build LinkedIn Ads URL MarketingUrlBuilder::linkedInAds($url, $campaign)
withUTM() Add UTM parameters $builder->withUTM($params)
withGoogleValueTrack() NEW: Add ValueTrack parameters $builder->withGoogleValueTrack()
withPlatform() NEW: Add platform-specific params $builder->withPlatform('google_ads', $params)

New Services & Events

Service/Event Description Example
PlatformManager NEW: Platform configuration management $manager->getEnabledPlatforms()
CookieManager NEW: Cookie tracking with consent $manager->getCookieValues($request)
MarketingDataCreated NEW: Marketing data creation event Event::listen(MarketingDataCreated::class, ...)
ConversionTracked NEW: Conversion tracking event Event::listen(ConversionTracked::class, ...)
ClickIdDetected NEW: Click ID detection event Event::listen(ClickIdDetected::class, ...)

New Traits

Trait Description Example
TracksConversions NEW: Conversion tracking functionality $model->trackLeadConversion(50.00)
TracksEcommerceEvents NEW: E-commerce event tracking $product->trackViewItem()

๐Ÿ”„ Upgrading from v1 to v2

Migration Overview

Version 2.0 introduces major new features while maintaining 100% backward compatibility. Your existing code will continue to work without any changes, but you can opt-in to enhanced features for improved functionality.

Step 1: Update the Package

Step 2: Publish New Configuration (Optional)

To access new features, publish the updated configuration:

โš ๏ธ Important: This will overwrite your existing config. Back up your current configuration first if you have custom settings.

Step 3: Enable New Features (Optional)

The new configuration includes several opt-in features. Enable them as needed:

Enable Enhanced Platform Support

Enable Click ID Management

Enable Events (for Analytics Integration)

Enable Auto-Observation (Advanced)

Enable Conversion Tracking

Enable E-commerce Tracking

Step 4: Update Your Code (Optional)

Your existing code will work without changes, but you can enhance it with new features:

Enhanced Click ID Access

Add New Traits for Enhanced Functionality

Use New URL Builder

Implement Event Listeners

Step 5: Test Your Implementation

After upgrading, verify everything works correctly:

Test Existing Functionality

Test New Click ID Priority

Test Platform Detection

Migration Checklist

Common Migration Issues

Issue: Configuration Override

Problem: New config overwrites custom settings Solution: Merge your custom settings with the new configuration structure

Issue: Events Not Firing

Problem: Events enabled but listeners not receiving them Solution: Ensure 'events' => ['enabled' => true] and check listener registration

Issue: Platform Not Detected

Problem: Platform detection returns null Solution: Ensure the platform is enabled in the new platforms configuration

Issue: Click IDs Not Prioritized

Problem: getPrimaryGoogleClickId() returns null Solution: Enable click ID management: 'click_id_management' => ['enabled' => true]

Getting Help

If you encounter issues during migration:

  1. Check Configuration: Ensure new config sections are properly configured
  2. Review Logs: Look for error messages in Laravel logs
  3. Test Incrementally: Enable one feature at a time to isolate issues
  4. Fallback: Disable new features if needed - v1 functionality will still work

What Stays the Same

โœ… All existing methods work exactly as before โœ… Database structure remains unchanged โœ… UTM parameter capture works identically โœ… Laravel Nova integration continues to work โœ… Basic click ID detection functions as before

What Gets Better

๐Ÿš€ Enhanced click ID priority with configurable extraction ๐Ÿš€ 12+ platform support with individual controls ๐Ÿš€ Advanced cookie tracking with consent management ๐Ÿš€ Event-driven architecture for analytics integration ๐Ÿš€ Conversion & e-commerce tracking with attribution ๐Ÿš€ URL builder for campaign management ๐Ÿš€ Wildcard pattern matching for flexible parameter capture


๐Ÿค Contributing

We welcome contributions! Please see CONTRIBUTING.md for details.

Development Setup


๐Ÿ“„ Changelog

Please see CHANGELOG for more information on what has changed recently.


๐Ÿ”’ Security

If you discover any security-related issues, please email [email protected] instead of using the issue tracker.


๐Ÿ’ก Use Cases

E-commerce Attribution

Track customer acquisition costs, measure ROAS, and optimize ad spend across platforms.

SaaS Conversion Tracking

Monitor trial-to-paid conversion rates by marketing channel and campaign.

Lead Generation

Attribute leads to their original marketing source for accurate ROI calculation.

Content Marketing

Track which content pieces drive the most valuable conversions.

Multi-Touch Attribution

Understand the complete customer journey across multiple touchpoints.


๐Ÿ† Why Choose This Package?

โœ… Battle-Tested - Used in production by hundreds of Laravel applications

โœ… Comprehensive - Supports more platforms than any other Laravel marketing package

โœ… Developer Friendly - Clean API, excellent documentation, and Laravel conventions

โœ… Performance Optimized - Minimal overhead with intelligent caching

โœ… Privacy Compliant - Built-in GDPR support and consent management

โœ… Actively Maintained - Regular updates and new platform support


๐Ÿ“ž Support


๐Ÿ“œ License

The MIT License (MIT). Please see License File for more information.


๐Ÿ‘ Credits


Made with โค๏ธ by the Marshmallow team

Star โญ this repo if you find it helpful!


All versions of marketing-data-tracker with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
spatie/laravel-package-tools Version ^1.16
illuminate/contracts Version ^10.0||^11.0||^12.0|^13.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package marshmallow/marketing-data-tracker contains the following files

Loading the files please wait ...