Giter VIP home page Giter VIP logo

segment's Introduction

Alt Three Segment

Build Status StyleCI Status Software License Packagist Downloads Latest Version

Installation

Alt Three Segment is a Segment bridge for Laravel. This version requires PHP 7.1-7.4, and supports Laravel 5.5-8. Simply require the package using Composer:

$ composer require alt-three/segment:^3.5

Once installed, if you are not using automatic package discovery, then you need to register the AltThree\Segment\SegmentServiceProvider service provider in your config/app.php.

Configuration

Alt Three Segment requires configuration.

To get started, you'll need to publish all vendor assets:

$ php artisan vendor:publish

This will create a config/segment.php file in your app that you can modify to set your configuration. Also, make sure you check for changes to the original config file in this package between releases.

Usage

Once you've set your write_key value in the configuration, you're ready to go! For the most part you can follow Segments own instructions however, you'll want to replace the Analytics classname with Segment - plus, you don't need to call class_alias.

Identify the user

Segment::identify([
    'userId' => '12345abcde',
    'traits' => [
        'name' => 'James Brooks',
        'email' => '[email protected]',
    ],
]);

Track actions

Segment::track([
    'userId' => '12345abcde',
    'event' => 'Did something',
    'properties' => [
        'was_awesome' => true,
    ],
]);

Security

Our full security policy is available to read here.

License

Alt Three Segment is licensed under The MIT License (MIT).

segment's People

Contributors

coquer avatar danrovito avatar grahamcampbell avatar jbrooksuk avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.