Download the PHP package remp/campaign-module without Composer

On this page you can find all versions of the php package remp/campaign-module. 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 campaign-module

Campaign

Campaign admin allows you to create banner campaigns without knowledge of HTML/CSS/JS, A/B test the banners and in combination with REMP Beam (for providing statistics) display and evaluate performance of your campaigns.

Integration with CMS/CRM

Javascript snippet

Include following snippet into the page to process campaigns and display banners. Update rempConfig object as needed.

Note: To automatically track banner events to BEAM Tracker, add also tracker property to rempConfig object. See BEAM README for details. The two snippets complement each other and can be combined into one big JS snippet including Campaign and Beam functionality.

Single-page applications

If you use single-page application and need to reinitialize JS library after it's been loaded:

  1. Update the rempConfig variable to reflect the navigation changes.
  2. Call remplib.campaign.init(rempConfig) again to reinitialize the JS tracking state. All existing banners will hide and campaigns will be evaluated again.

Segment integration

To determine who to display a campaign to, Campaign is dependent on user segments - effectively lists of user/browser IDs which should see a banner. You can register as many segment providers as you want, the only condition is that the providers should work with the same user-base (one user ID has to always point to the) same user.

The implementation is required to implement App\Contracts\SegmentContract interface.

All registered implementations are hidden behind facade of SegmentAggregator. This facade is then used to display available segments in configuration listings and to evaluate actual members of segments during campaign runtime.

If you want to link the Campaign to your own system, these are the methods to implement:

When implemented, create a segment provider providing the instance of your implementation. The provider should set \App\Contracts\SegmentAggregator::TAG to the class so your implementation would get also registered to the SegmentAggregator.

Banner custom styles

Banners use default system fonts. If you want to use your own fonts you can add styles for .remp-banner .serif and .remp-banner .sans-serif to custom css field, or directly to web page using campaign showtime functionality.

Example:

Settings and features

Campaign position collision resolving (experimental)

By default, Campaign displays all active and matched banners to the positions they're intended to be displayed at. If you want to ensure that there's always only one banner displayed at a single position, you can enable this feature with ENV variable:

When this feature is enabled and the system resolves multiple banners at the same position, the rules are:

Collapsible banner state storing

Collapsible banner stores its collapse state and displays in the same state on the next display (expanded, collapsed). If user collapses campaign banner then it displays collapsed on the next display and vice versa.

In collapsible banner settings there is a toggle to override this behaviour and display banner always in initial state.

Snippets

Campaign supports use of snippets in your banner template contents, custom javascript and custom css. You can create snippets using Add new snippet in the Snippets main menu section.

You can use created snippets by adding {{ snippet_name }} to one of the fields used in banner content or in custom javascript & css.

Campaign Debugger

To be able to debug live campaigns and troubleshoot problems, Campaign provides Campaign Debugger tool.

Set CAMPAIGN_DEBUG_KEY in Campaign .env file. It can be any (preferrably random) value - you will be asked for the key later, when working with debugger.

To start debugger, go to page that displays campaign(s) you want to debug and append #campaignDebug to the URL. In the debugger window, fill in required parameters Debug key and Campaign public ID and submit. After page reload, debugger should provide you with a reason why the particular campaign was shown/not shown.

API Documentation

Campaign provides a simple API for several tasks described bellow.

All examples use http://campaign.remp.press as a base domain. Please change the host to the one you use before executing the examples.

All examples use XXX as a default value for authorization token, please replace it with the real token API token that can be acquired in the REMP SSO.

All requests should contain (and be compliant) with the follow HTTP headers.

API responses can contain following HTTP codes:

Value Description
200 OK Successful response, default value
202 Accepted Successful response, accepted for processing
400 Bad Request Invalid request (missing required parameters)
403 Forbidden The authorization failed (provided token was not valid)
404 Not found Referenced resource wasn't found

If possible, the response includes application/json encoded payload with message explaining the error further.


POST /api/banners/BANNER_ID/one-time-display

Campaign supports one-time display of banners to specific users. Such banner does not need associated campaign to be displayed. This can be used e.g. as a way of reminding users about required actions (instead of notifying them via email).

When calling this endpoint, please replace BANNER_ID in URL with an actual ID of the banner. Each one-time banner has to specify its expiration date and a user it shows to (targeted either via user ID or via browser ID).

Body:
Examples:
curl
raw PHP
Response:

Valid response with 202 HTTP code:

Override user's presence in segment's cache

If segment provider supports it, Campaign will cache members of segment for faster access. If segment is dynamic (changed often), it can lead to incorrect campaign targeting (old data).

Note: Interval for cache invalidation is set to one hour (check App\Console\Kernel->schedule()).

These two API endpoints allow overriding membership of one user in cached segment from outside of Campaign (eg. from CRM).

Both endpoints return response 404 Not found if segment is not actively used by active or scheduled campaign.

API path parameters:
Parameter Type Required Description
segment_provider string yes Segment's provider returned by SegmentContract->provider().
_Eg. out of box contracts: crm_segment/pythia_segment/remp_segment._
segment_code string yes Code which identifies segment _(stored in campaign_segments.code)_.
Body:
Examples:
curl Path parameters: - segment_provider - `crm_segment` - segment_code - `example_testing_segment`
raw PHP
Response:

Valid response with 202 HTTP code:

Response with 404 HTTP code:

Newsletter Banner

This banner type allows you to directly collect newsletter subscribers.

In most cases you are going to need your own API proxy, since most newsletter APIs (including REMP CRM) make use of private tokens that should not be exposed to client. In case your newsletter API does not require such, you might not need a proxy.

Setup

All configuration options are set via .env, refer to .env.example for full list of available options.

API requirements

Newsletter API is required to respond with proper HTTP response code. On both success and failure, there is and custom event emitted. See next section for details.

Custom Events

Custom events rempNewsletterSubscribeFailure or rempNewsletterSubscribeSuccess are available if requests are configured with XHR. Events are fired on form element. Event contains following items in detail prop:

field type description
type String response - if there is a valid XHR response
exception - for general error, e.g. connection error
response Object fetch response object, applicable for response type
message String error message, applicable for exception type
Error handling example

Healthcheck

Route http://campaign.remp.press/health provides health check for database, Redis, storage and logging.

Returns:

MaxMind - GeoIP2 Lite

This product includes GeoLite2 data created by MaxMind, available from http://www.maxmind.com. Due to the licence changes, you need to update the database manually. If you do, provide path to the updated database via MAXMIND_DATABASE environment variable.

RTM tracking

Following params are added to every request or link within banners. They serve for campaign performance tracking.


All versions of campaign-module with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-intl Version *
ext-json Version *
cache/predis-adapter Version ^1.0
cache/redis-adapter Version ^1.2
doctrine/dbal Version ^3.1
fico7489/laravel-pivot Version ^3.0
fideloper/proxy Version ^4.4
fruitcake/laravel-cors Version ^2.0
geoip2/geoip2 Version ~2.0
guzzlehttp/guzzle Version ^7.0.1
kouz/laravel-airbrake Version ^0.7.0
laracasts/flash Version ^3.2
laravel/framework Version v8.76.2
laravel/serializable-closure Version ^1.2
laravelcollective/html Version ^6.2
nicolaslopezj/searchable Version ^1.13
php-amqplib/php-amqplib Version ^2.7
piwik/device-detector Version ^3.10
predis/predis Version ^1.1
remp/laravel-helpers Version *
remp/laravel-sso Version *
remp/laravel-widgets Version *
remp/remp-commons Version *
sentry/sentry-laravel Version ^2.5
spatie/laravel-searchable Version ^1.9
symfony/psr-http-message-bridge Version ^v2.1.2
tightenco/ziggy Version ^1.2
ukfast/laravel-health-check Version ^1.5
yajra/laravel-datatables-oracle Version ^9.18
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 remp/campaign-module contains the following files

Loading the files please wait ....