Download the PHP package automattic/jetpack-stats without Composer

On this page you can find all versions of the php package automattic/jetpack-stats. 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 jetpack-stats

Stats

Collect valuable traffic stats and insights.

How to consume Stats package

Install the right packages

First, let's make sure that the automattic/jetpack-stats package is set up in your composer.json file:

At minimum you need three things. One is the automattic/jetpack-autoloader package, which will ensure that you're not colliding with any other plugins on the site that may be including the same packages. Two, of course, is the automattic/jetpack-stats package. Third is our automattic/jetpack-config package that will be your tool for initializing the packages.

Initialize the package

Second, we must initialize ("configure") the jetpack-stats package within your plugin, and provide the information about it.

This is where the jetpack-config and jetpack-autoload packages come into play. Do this, and you're ready to start consuming the Jetpack connection!

Tracking Pixel

Stats Package uses a tracking pixel to send information to WordPress.com.

This is done by enqueueing a JavaScript file in the footer of the site https://stats.wp.com/e-202103.js (the number changes every week but the file remains the same). That JavaScript file, in turn, inserts a tracking pixel to the end of the page. For example: https://pixel.wp.com/g.gif?lots_of_parameters_here When that tracking pixel is loaded by the browser, it effectively sends information to WordPress.com about what needs to be logged on.

Parameters tracked

Default parameters

The default parameters being tracked are built with the Automattic\Jetpack\Stats\TrackingPixel::build_view_data function.

How to extend default parameters

There is a filter that can be used to track more parameters. stats_array

WPCOM Stats API

The stats package provides an easy to use API that Fetches data from WPCOM.

Available Methods

Inside Automattic\Jetpack\Stats\WPCOM_Stats class you can find the following methods. All of them internally rely on the following method Automattic\Jetpack\Connection\Client::wpcom_json_api_request_as_blog.

Using this package in your WordPress plugin

If you plan on using this package in your WordPress plugin, we would recommend that you use Jetpack Autoloader as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.

Security

Need to report a security vulnerability? Go to https://automattic.com/security/ or directly to our security bug bounty site https://hackerone.com/automattic.

License

stats is licensed under GNU General Public License v2 (or later)


All versions of jetpack-stats with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
automattic/jetpack-connection Version ^2.7.0
automattic/jetpack-constants Version ^2.0.1
automattic/jetpack-status Version ^2.2.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 automattic/jetpack-stats contains the following files

Loading the files please wait ....