1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 13:42:49 +01:00

Improvements to analytics

This commit is contained in:
Hillel Coren 2016-07-28 12:11:14 +03:00
parent c638b40f83
commit 9fd85f1f26

View File

@ -28,13 +28,14 @@ class AnalyticsListener
$analyticsId = env('ANALYTICS_KEY');
$client = $payment->client;
$amount = $payment->amount;
$item = $invoice->invoice_items->last()->product_key;
$base = "v=1&tid={$analyticsId}&cid={$client->public_id}&cu=USD&ti={$invoice->invoice_number}";
$url = $base . "&t=transaction&ta=ninja&tr={$amount}";
$this->sendAnalytics($url);
$url = $base . "&t=item&in=plan&ip={$amount}&iq=1";
$url = $base . "&t=item&in={$item}&ip={$amount}&iq=1";
$this->sendAnalytics($url);
}