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

Improvements to analytics

This commit is contained in:
Hillel Coren 2016-07-28 12:10:57 +03:00
parent 6fd4f85b11
commit 52fb4ae7c2

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);
}