sendTrackingEvent :: Text -> Maybe (Entity Signup) -> Text -> Maybe Text -> HandlerT App IO ()
sendTrackingEvent uaCode maybeSignup jobName content = do
  case maybeSignup of
    Just (Entity signupId _) -> do
      let uid = T.pack $ show signupId
      payload <- liftIO $ mkTrackingPayload uaCode jobName uid content
      _ <- trackingPostRequest payload
      return ()
    Nothing -> return ()

-- | Track the events with Google Analytics.
sendTrackingEvent :: Text -> Maybe (Entity Signup) -> Text -> Maybe Text -> HandlerT App IO ()
sendTrackingEvent uaCode maybeSignup jobName content = do
  case maybeSignup of
    Just (Entity signupId _) -> do
      let uid = T.pack $ show signupId
      payload <- liftIO $ mkTrackingPayload uaCode jobName uid content
      _ <- trackingPostRequest payload
      return ()
    Nothing -> return ()

-- | Track the events with Google Analytics.
sendTrackingEvent uaCode maybeSignup jobName content = do
  case maybeSignup of
    Just (Entity signupId _) -> do
      let uid = T.pack $ show signupId
      payload <- liftIO $ mkTrackingPayload uaCode jobName uid content
      _ <- trackingPostRequest payload
      return ()
    Nothing -> return ()

-- | Track the events with Google Analytics.