Download the PHP package zfhassaan/genlytics without Composer
On this page you can find all versions of the php package zfhassaan/genlytics. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download zfhassaan/genlytics
More information about zfhassaan/genlytics
Files in zfhassaan/genlytics
Package genlytics
Short Description Genlytics is a powerful Google Analytics Composer package that allows for easy data collection, analysis, and visualization. Optimized for SEO, it helps improve website performance and drive more organic traffic.
License MIT
Informations about the package genlytics
Disclaimer
The google UA Property is going away from July 2023. Google is implementing the Google Analytics V4. Universal Analytics will no longer process new data in standard properties beginning on 1 July 2023. Prepare now by setting up and switching over to a Google Analytics 4 property. LearnMore
The Google Analytics data will only be available through the GCP API
Pending Tasks
- Creating Test cases for Genlytics Package
- Writing yml file for running tests
About
Genlytics is a powerful Google Analytics package for Laravel, designed to help businesses and developers easily track and analyze website traffic and user behavior. Our package integrates seamlessly with your Laravel application, allowing you to access all of the features and functionality of Google Analytics without the need for any additional code. With Genlytics, you can easily track page views, user sessions, and conversion rates, as well as gain valuable insights into your audience and website performance. Whether you're a small business looking to improve your online presence, or a developer looking to add analytics functionality to your Laravel app, Genlytics has everything you need to succeed. The package was created to fetch Google Analytics data in a laravel dashboard
Intended Audience
This document is for developers who want to fetch Google Analytics Data into their Laravel website and show the content on a dashboard.
Query
With Genlytics, you can easily access and query your Google Analytics data using the GA4 property. You can check your website traffic, user behavior, and conversion rates using the GA4 query explorer at https://ga-dev-tools.web.app/ga4/query-explorer/. This powerful tool allows you to create custom queries and gain valuable insights into your website performance. Whether you're looking to track specific metrics or analyze user behavior, the GA4 query explorer provides the flexibility and functionality you need to make data-driven decisions for your business.
Prerequisites
Before integrating Genlytics, a powerful Google Analytics package for Laravel, into your application, it's essential to have a property created on Google Analytics v4 and data stream set up. This will ensure that all of your website's data is being properly collected and tracked by Google Analytics. Once the property and data stream are in place, you can easily integrate Genlytics with your Laravel application, providing you with valuable insights into your website traffic, user behavior, and conversion rates. With the ability to access all of the features and functionality of Google Analytics, Genlytics makes it simple for businesses and developers to understand their audience and improve their online performance.
Enable API and Create Service Account
To get started using Analytics Reporting API v4, you need to first use the setup tool, which guides you through creating a project in the Google API Console, enabling the API, and creating credentials.
Create credentials
Note: When prompted click Furnish a new private key and for the Key type select JSON, and save the generated key as client_secrets.json; you will need it later in the tutorial.
- Open the Service accounts page. If prompted, select a project.
- Click + Create Service Account, enter a name and description for the service account. You can use the default service account ID, or choose a different, unique one. When done click Create.
- The Service account permissions (optional) section that follows is not required. Click Continue.
- On the Grant users access to this service account screen, scroll down to the Create key section. Click add Create key.
- In the side panel that appears, select the format for your key: JSON is recommended.
- Click Create. Your new public/private key pair is generated and downloaded to your machine; it serves as the only copy of this key. For information on how to store it securely, see Managing service account keys.
- Click Close on the Private key saved to your computer dialog, then click Done to return to the table of your service accounts.
Add service account to the Google Analytics account
The newly created service account will have an email address that looks similar to:
Use this email address to add a user to the Google Analytics view you want to access via the API. For this package only Read & Analyze permissions are needed.
Installation
You can install the package via composer
Enviornment Variables
Easily integrate Google Analytics tracking with your Laravel application using Genlytics and its environment variables. To set up Genlytics, simply add your Google Analytics property ID and service account credentials as environment variables in your .env file. The GENLYTICS_PROPERTY_ID variable is used to specify your specific GA property and the GENLYTICS_CREDENTIALS variable is used to specify the location of your service-account.json file. With these environment variables in place, you can start tracking website traffic, user behavior, and conversion rates using the power of Google Analytics and Genlytics package for Laravel, making it easy for businesses and developers to understand their audience and improve their online performance.
Configurations
In your config/app.php file, add the following line to the providers array:
In the aliases array of the same file, add the following line:
Publish the package assets by running the following command:
and publish the zfhassaan\genlytics\provider\AnalyticsServiceProvider
resources to the laravel app.
Usage
Genlytics is a powerful Google Analytics package for Laravel that allows you to easily track and analyze website traffic and user behavior. To start using Genlytics, you can create an instance of the package by initializing it like this:
You can then use the package's methods to run various reports. For example, you can run a report for active users within a specific date range by calling the runReports method like this:
In addition to running reports, Genlytics also provides a method to fetch real-time analytics data using runRealTime function. For example:
Genlytics also provides a method RunDimensionReport to fetch the dimension, for example:
These methods allows to easily access the data we need to make data-driven decisions for business.
All versions of genlytics with dependencies
php Version ^8.1
google/analytics-data Version ^0.9.0
google/gax Version ^1.18
google/common-protos Version ^1.3.1||^2.0||^3.0
google/longrunning Version ^0.2
grpc/grpc Version ^1.13
google/protobuf Version ^3.21
google/cloud-core Version ^v1.48.1
google/grpc-gcp Version ^0.2.1
google/auth Version ^v1.24.0