A Segment package for Laravel

0.0.2 2018-08-31 00:53 UTC

This package is not auto-updated.

Last update: 2024-04-20 07:16:32 UTC


README

A Segment package for Laravel.

The goal of this package is to make it easier to use Segment within a Laravel package. It formats the data as needed and uses segmentio/analytics-php to make the API calls.

Installation

Currently Laravel 5.6 is the only version supported.

Require the package:

composer require fostermadeco/pool

Publish the config:

php artisan vendor:publish

Add default destinations to the integrations array in the segment config file, for example:

    'integrations' => [
        'All' => false,
        'Google Analytics' => true,
        'Optimizely' => true,
    ],

Add SEGMENT_WRITE_KEY to your .env file and assign it the value of the write key Segment provides for your source:

SEGMENT_WRITE_KEY=

Further setup is detailed in the documentation below.

Calls

  1. Identify
  2. Track
  3. Page
  4. Screen
  5. Group
  6. Alias