Download the PHP package keithbrink/segment-spark without Composer

On this page you can find all versions of the php package keithbrink/segment-spark. 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 segment-spark

SegmentSpark

An automatic Segment analytics package for Laravel Spark, which will track all page views and eCommerce events in Segment.

Installation

This version requires PHP 7, and supports Laravel 5.5+ and Spark 5+.

To get the latest version, simply require the project using Composer:

On Laravel 5.5+, the KeithBrink\SegmentSpark\SegmentSparkServiceProvider service provider and KeithBrink\SegmentSpark\SegmentSparkFacade facade will be automatically discovered so it will not need to be added to your config. On previous versions, you will need to add those manually to your config/app.php.

Configuration

First, set your Segment write key in your .env file:

MIX_SEGMENT_WRITE_KEY=xxx

Prefixing the property with MIX_ will allow the value to be accessed in Javascript.

Next, you'll need to publish the resources:

You can also optionally publish the segment-spark.php config file:

The first publish command creates a resources/js/segment-spark.js file, which is a Vue plugin you will need to include in your resources/js/app.js file.

Remember that you will need to run npm run dev to compile your assets.

If you would like to associate server-side analytics requests with the client tracked by Google Analytics, you will need to add an exception for cookie encryption in the EncryptCookies middleware at app\Http\Middleware\EncryptCookies.php:

It's also a good idea to add User-ID Tracking to Google Analytics.

Usage

After you have set your write key and added Vue plugin to app.js, the package will automatically track all of your page views (including the various tabs on the settings page) and will send events for eCommerce activity, such as viewing, subscribing, renewing, switching, or cancelling a plan.

Logged in users will be automatically tracked using their user ID ($user->id), and their entire user object will be included as traits.

If you are using Google Analytics, the server side events will automatically use the Google Analytics cookie to track events to correct user. Remember to set the server-side tracking ID in Segment's Google Analytics settings.

If you would like to track any custom events, you can use the original Segment class.

Or, use the original Javascript Segment library.

Google Analytics Enhanced eCommerce

If you would like to use Google Analytics enhanced eCommerce, this package will automatically track two checkout steps: When the user clicks the Select button on one of the plans (Step 1), and when the user clicks the Subscribe button after filling out their billing information (Step 2). You can name those steps whatever you like in your Google Analytics enhanced eCommerce settings.

Remember that you will need to activate Google Analytics enhanced eCommerce on both Google Analytics and Segment.

License

SegmentSpark is licensed under The MIT License (MIT).

Thanks To

This library borrows code and design structure from AltThree/Segment and Ipunkt/LaravelAnalytics.


All versions of segment-spark with dependencies

PHP Build Version
Package Version
Requires segmentio/analytics-php Version 1.*
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 keithbrink/segment-spark contains the following files

Loading the files please wait ....