Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/garu/net-google-analytics-measurementprotocol
Send Google Analytics user interaction data from Perl
https://github.com/garu/net-google-analytics-measurementprotocol
Last synced: 11 days ago
JSON representation
Send Google Analytics user interaction data from Perl
- Host: GitHub
- URL: https://github.com/garu/net-google-analytics-measurementprotocol
- Owner: garu
- Created: 2015-05-14T02:02:44.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-05-19T21:06:09.000Z (over 1 year ago)
- Last Synced: 2024-11-05T21:50:27.048Z (about 2 months ago)
- Language: Perl
- Size: 26.4 KB
- Stars: 0
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changes
Awesome Lists containing this project
README
## Net-Google-Analytics-MeasurementProtocol ##
This is a Perl interface to [Google Analytics Measurement Protocol](https://developers.google.com/analytics/devguides/collection/protocol/ga4),
allowing developers to make HTTP requests to send raw user interaction data
directly to Google Analytics 4 (GA4) servers. It can be used to tie online
to offline behaviour, sending analytics data from both the web
(via JavaScript) and from the server (via this module).```perl
use Net::Google::Analytics::MeasurementProtocol;my $ga = Net::Google::Analytics::MeasurementProtocol->new(
api_secret => '...',
measurement_id => '...',
);$ga->send( level_up => { character => 'Alma', level => 99 } );
$ga->send_multiple([
{
purchase => {
transaction_id => 'T-1234',
currency => 'USD',
value => 14.99,
coupon => 'SPECIALPROMO',
shipping => 2.99,
tax => 0.37,
items => [
{ item_id => 'X-1234', item_name => 'Amazing Tee' },
{ item_id => 'Y-4321', item_name => 'Cool Shades' },
],
},
},
{
earn_virtual_currency => {
virtual_currency_name => 'StoreCash',
value => 999,
},
},
]);
```See [Google's complete parameter reference](https://developers.google.com/analytics/devguides/collection/protocol/ga4/reference?client_type=gtag) for all the events and parameters you can pass.
#### Installation ####
cpanm Net::Google::Analytics::MeasurementProtocol
or manually:
perl Makefile.PL
make test
make installPlease refer to [this module's complete documentation](https://metacpan.org/pod/Net::Google::Analytics::MeasurementProtocol)
for extra information.This module is free software; you can redistribute it and/or modify it
under the same terms as Perl itself. See L.Google and Google Analytics are trademarks of Google LLC.
This software is not endorsed by or affiliated with Google in any way.