2017 © Pedro Peláez
 

library eephp

Google Enhanced Ecommerce PHP Lib

image

erikh60/eephp

Google Enhanced Ecommerce PHP Lib

  • Monday, May 21, 2018
  • by erikh60
  • Repository
  • 0 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Enhanced Ecommerce Library for PHP

Requirements

PHP 5.3.0 and later., (*1)

Composer (Github is most always most recent. My Packagist will lag)

You can install the bindings via Composer. Run the following command:, (*2)

composer require erikh60/eephp

To use the bindings, use Composer's autoload:, (*3)

require_once('vendor/autoload.php');

Manual Installation

If you don't use Composer, you can download the latest release., (*4)

require_once('/path/to/Eephp.php');

Dependencies

Require the following extension in order to work properly:, (*5)

If you use Composer, it should get handled automatically. If you install manually, make sure on your own., (*6)

Getting Started

Enhanced Ecommerce/GTM Details here:
// https://developers.google.com/tag-manager/enhanced-ecommerce

Set GA Funnels to match the steps as described here:
// https://developers.google.com/analytics/devguides/collection/analyticsjs/enhanced-ecommerce#ecommerce-data

Steps:
//step1 -- search results  
//step2 -- product details page with "might also like"  
//step3 (optional) -- donate/addtocart -- before amounts/designation/dedication given
//step4 -- add--add to cart (with/after price)
//step4 -- remove--remove from cart
//step5 -- checkout steps
    //step:5.1 view/review cart 
    //step:5.2 choose--guest/login/new (not in express)
    //step:5.3 account page (not in express)
    //step:5.4 enter or review address (not in express)
    //step:5.5 review order
    //step:5.6 pay via paypal or stripe
//step6 -- purchase --checkout thankyou

///XXX -- not yet -- Refunds

Simple Usage

For example to load the proper JS for a thank-you/confirmation at the end of checkout:, (*7)

\Eephp\Eephp::set_cart_id('...');
$cart_id =  \Eephp\Eephp::get_cart_id();
$js =  \Eephp\Eephp::ee_load_thankyou($cart_id);

echo $js;

Full examples for Steps above in Test.php, (*8)

JS in the Wild

View Source at cfp-dc.org, (*9)

The Versions

21/05 2018

dev-master

9999999-dev http://erikhaugsjaa.com/

Google Enhanced Ecommerce PHP Lib

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-json *

 

The Development Requires

api google analytics google tag manager google enhanced ecommerce