             url: URL(string: "http://example.com")!.appendingPathComponent(action.joined(separator: "/")),
             actionName: action,
             language: Locale.httpAcceptLanguage,
-            isNewSession: false, // set this to true once we can start a new session
+            isNewSession: nextEventStartsANewSession,
             referer: nil,
             eventCategory: nil,
             eventAction: nil,

    private(set) var isDispatching = false
    
    
    /// Manually start the dispatching process.
    public func dispatch() {
        guard !isDispatching else { return }
        guard queue.eventCount > 0 else {

            uuid: NSUUID(),
            visitor: visitor,
            session: session,
            date: Date(),
            url: URL(string: "http://example.com")!,
            actionName: [],
            language: Locale.httpAcceptLanguage,
            isNewSession: nextEventStartsANewSession,
            referer: nil,
            eventCategory: category,
            eventAction: action,
