 (def AnalyticsEvent
   (merge
     CoreAnalyticsEvent
-    {:owner s/Any}))
-
-(def AnalyticsEventForControllers
-  (merge
-    CoreAnalyticsEvent
-    {:current-state {s/Any s/Any}}))
+    (s/either {:owner s/Any}
+              {:current-state {s/Any s/Any}})))
 
 (def PageviewEvent
   (merge
-    AnalyticsEventForControllers
+    AnalyticsEvent
     {:navigation-point s/Keyword}))
 
 (def ExternalClickEvent

(defmulti track (fn [data]
                  (when (frontend.config/analytics-enabled?)
                    (cond
                      (supported-click-and-impression-events (:event-type data)) :track-click-and-impression-event
                      (supported-controller-events (:event-type data)) :track-controller-events
                      :else (:event-type data)))))

(defmethod track :default [data]
  (when (frontend.config/analytics-enabled?)
    (merror-unsupported-event (:event-type data))))

(s/defmethod track :track-click-and-impression-event [event-data :- AnalyticsEvent]
  (let [{:keys [event-type properties owner]} event-data]
    (segment/track-event event-type (supplement-tracking-properties-from-owner properties owner))))

;; Gotta finish this + add schema event
(s/defmethod track :track-controller-events [event-data :- AnalyticsEventForControllers]
  (let [{:keys [event-type properties current-state]} event-data]
    (segment/track-event event-type (supplement-tracking-properties-from-state properties current-state))))


                      {:vcs-url (vcs-url/project-name (:vcs_url build))
                       :outcome (:outcome build)}))))

(s/defmethod track :init-user [event-data :- AnalyticsEvent]
  (segment/identify (get-user-properties-from-state (:current-state event-data))))
