Download the PHP package eonvisualmedia/laravel-klaviyo without Composer

On this page you can find all versions of the php package eonvisualmedia/laravel-klaviyo. 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 laravel-klaviyo

laravel-klaviyo

This package assists with interacting with Klaviyo to track client and server-side metrics and the REST api.

Requirements

For server-side track, identify or REST api calls this package utilises the Laravel HTTP Client.

It is recommended that server-side events are processed in the background, by default jobs are placed on the klaviyo queue.

Installation

You can install the package via composer:

The package will automatically register itself.

You can optionally publish the config file with:

Depending upon your intended usage minimally you'll need to configure your environment with your public and private api keys.

Usage

Basic Example

First you'll need to include the Klaviyo JavaScript API for Identification and Tracking by including it at the end of your layout just before the closing body tag.

To add identity

If the current user is not identified and Auth::user() is an instance of EonVisualMedia\LaravelKlaviyo\Contracts\KlaviyoIdentity then the getKlaviyoIdentity method will be called and an identify event added to the page.

Alternatively the identify method may be called explicitly, for instance after user login.

Track events client-side

Track events server-side:

To queue server-side events.

You can optionally also specify the customer properties and timestamp, if not specified the customer will attempt to be identified by their cookie ($exchange_id) or their user model if Auth::user() is an instance of EonVisualMedia\LaravelKlaviyo\Contracts\KlaviyoIdentity.

Monitoring Login Events

By default, the package will subscribe to Illuminate\Auth\Events\Login events and dispatch an klaviyo.identify(...) call.

This behaviour can be disabled using the config option identify_on_login.

Advanced usage

Macros

The package allows you to extend its functionality, this can be helpful for creating reusable events.

You may define macros within the boot method of a service provider, either your own or within the application's App\Providers\AppServiceProvider class.

With the macro defined you may invoke it anywhere in your application:

REST

You may interact with the Klaviyo REST api using the Laravel HTTP Client, calls forwarded via KlaviyoClient append a Authorization: Klaviyo-API-Key your-private-api-key header to requests.

Upgrading from v1

The Klaviyo legacy v1/v2 APIs are scheduled to retire June 30th, 2024.

I would encourage you to review especially the breaking changes on the Klaviyo: API versioning and deprecation policy

The API changes have therefore necessitated a few breaking changes to this package, specifically the payloads required for identify and push. See the examples below, for example the getKlaviyoIdentity response replaces $email with email.

Also take note that client and server payloads for identify/profile have a few differences klaviyo_client_to_server_profile may be of assistance help converting client payloads to server profiles.


All versions of laravel-klaviyo with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
guzzlehttp/guzzle Version ^7.0
illuminate/bus Version ^8.0|^9.0|^10.0|^11.0
illuminate/http Version ^8.0|^9.0|^10.0|^11.0
illuminate/support Version ^8.0|^9.0|^10.0|^11.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 eonvisualmedia/laravel-klaviyo contains the following files

Loading the files please wait ....