Giter VIP home page Giter VIP logo

web-sdk-php's Introduction

Finteza PHP SDK

The official sdk for sending events to Finteza servers and proxying analytical requests via the website.

Requirement

  • PHP 5.3+

Installation

Use the Сomposer package manager to install SDK easily.

Run the following command from the console:

composer require finteza-analytics

Usage

Sending events

Use the FintezaAnalytics::event(); method to send events to Finteza

Inputs:

Parameter Type Description
name * string Event name. The maximum length is 128 symbols.
websiteId * string Website ID. It can be obtained in the website settings (ID field) of the Finteza panel.
url string Optional. Finteza server address.
referer string Optional. Host of a website SDK is called on.
value number Optional. Additional parameter value.
unit string Optional. Additional parameter measurement units, for example, USD, items, etc. The maximum length is 32 symbols.

Example:

use FintezaAnalytics;

// sending event
FintezaAnalytics::event( array(
    'name' => 'Server+Track+Test',
    'websiteId' => 'sbnonjcmrvdebluwjzylmbhfkrmiabtqpc'
) );

See Finteza help for more details on sending events.

Proxying analytical scripts

Use the FintezaAnalytics::proxy(); method to proxy all analytical requests in Finteza

Inputs:

Parameter Type Description
path * string Start of the path for requests to be proxied.
token * string Token for signing the X-Forwarder-For header. You can get this value in the website settings (ID field) of the Finteza panel.
url string Optional. Finteza server address.

Example:

use FintezaAnalytics;

// proxy request
FintezaAnalytics::proxy( array(
    "path" => "/fz",
    "token" => "lopvkgcafvwoprrxlopvkgcafvwfzsrx"
) );

We recommend calling this method at each website request. SDK sorts out analytical requests on its own and proxies them to the Finteza servers.

Also, Finteza counter code installed on the website should be changed for correct operation.

See Finteza help for more details on configuring proxying.

License

Released under the BSD License.

web-sdk-php's People

Contributors

finteza avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.