Download the PHP package heyday/silverstripe-googlecontentexperiments without Composer

On this page you can find all versions of the php package heyday/silverstripe-googlecontentexperiments. 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 silverstripe-googlecontentexperiments

SilverStripe Google Content Experiments

Integration with Google Content Experiments for SilverStripe. Allows for Experiment Data to be integrated with your application so that experiments can be served without the usage of the GCE javascript implementation. For more information please see running a server-side experiment.

License

SilverStripe Google Content Experiments is released under the MIT license

Installation

If using SilverStripe version 2.4, please use the 1.0.0 tag

$ composer require silverstripe-googlecontentexperiments

How to use

Setup

First you must set up the correct authentication details so that Google Content Experiments can retrieve data from your Google Analytics account.

To do this:

Once this is done, you will see the details for the service account. From here, you will need to copy the email address which was generated and add it to the analytics account you are targeting with 'Read & Analyze' access only. This will allow the server connection to read your experiment data.

Configuration

Once you have set up the account and downloaded the private key for your application we have to configure the service. This can be completed in your _config.php with the following. This code sets up the dependancy injection container which is used.

Generally the following applies:

You also need to include the GoogleContentExperimentScripts somewhere on the page(s) you want to test.

Its also a wise move to set up a cron job which will run the processor periodically for you and pick up the new experiments so that you can then run them. This also will update variations status as the experiments progress.

Usage in templates

Templates are set up so that you can push the code without having to worry about the experiment being set up or running. This means that there is a necessary <% else %> to make sure that when experiments finish the page goes back to 'normal' until it can be updated to the winning solution.

GoogleContentExperimentVariation() takes two parameters, which are separated by an underscore. The first is the VariationID we are checking for, the second is the ExperimentID (internal ID). The above example shows three variation possibilities for ExperimentID 1.

If you are only running one experiment per page, the ExperimentID is not needed, e.g. <% if GoogleContentExperimentVariation(0) %>

Contributing

Unit Testing

$ composer install --prefer-dist --dev
$ phpunit

Code guidelines

This project follows the standards defined in:


All versions of silverstripe-googlecontentexperiments with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.2
composer/installers Version ~1.0
nyholm/google-api-php-client Version ~0.1
pimple/pimple Version ~1.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 heyday/silverstripe-googlecontentexperiments contains the following files

Loading the files please wait ....