Anonymous Segment.com tracking. Closes #91.
This commit is contained in:
committed by
Joseph Cohen
parent
a63c65a6c3
commit
5c391cc888
@@ -22,6 +22,10 @@ class HomeController extends Controller
|
||||
*/
|
||||
public function showIndex()
|
||||
{
|
||||
segment_track('Status Page', [
|
||||
'event' => 'Landed',
|
||||
]);
|
||||
|
||||
$components = Component::orderBy('order')->orderBy('created_at')->get();
|
||||
|
||||
$allIncidents = [];
|
||||
@@ -38,6 +42,21 @@ class HomeController extends Controller
|
||||
try {
|
||||
// If date provided is valid
|
||||
$oldDate = Date::createFromFormat('Y-m-d', Binput::get('start_date'));
|
||||
|
||||
segment_track('Status Page', [
|
||||
'start_date' => $oldDate->format('Y-m-d'),
|
||||
]);
|
||||
|
||||
if (Setting::get('app_tracking')) {
|
||||
Segment::track([
|
||||
'userId' => Config::get('app.key'),
|
||||
'event' => 'Home Page',
|
||||
'properties' => [
|
||||
'start_date' => $oldDate,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
// If trying to get a future date fallback to today
|
||||
if ($today->gt($oldDate)) {
|
||||
$startDate = $oldDate;
|
||||
|
||||
Reference in New Issue
Block a user