analytics search_press

This commit is contained in:
Nordup 2023-06-05 01:13:07 +03:00
parent 9a67e6a30b
commit 41c501c649
4 changed files with 17 additions and 0 deletions

View file

@ -31,6 +31,12 @@ func app_exit(time_spend: int) -> Dictionary:
# GATE
func search_press(url: String) -> Dictionary:
var event = base("search_press")
event.gate_url = url
return event
func gate_open(url: String) -> Dictionary:
var event = base("gate_open")
event.gate_url = url

View file

@ -8,6 +8,7 @@ var gate_url: String
func _ready() -> void:
gate_events.search_pressed.connect(send_search_press)
gate_events.open_gate.connect(send_gate_open)
gate_events.gate_entered.connect(send_gate_enter)
gate_events.exit_gate.connect(send_gate_exit)
@ -19,6 +20,10 @@ func _ready() -> void:
Analytics.send_event(JSON.parse_string(json))
func send_search_press(url: String) -> void:
Analytics.send_event(AnalyticsEvents.search_press(url))
func send_gate_open(url: String) -> void:
gate_url = url
gate_open_time = int(Time.get_ticks_msec() / 1000)

View file

@ -1,6 +1,7 @@
extends Resource
class_name GateEvents
signal search_pressed(url: String)
signal open_gate(url: String)
signal gate_info_loaded(gate: Gate)
signal gate_loaded(gate: Gate)
@ -16,6 +17,10 @@ func open_gate_emit(url: String) -> void:
open_gate.emit(url)
func search_pressed_emit(url: String) -> void:
search_pressed.emit(url)
func gate_info_loaded_emit(gate: Gate) -> void:
current_gate = gate
gate_info_loaded.emit(gate)

View file

@ -24,6 +24,7 @@ func _on_go_pressed() -> void:
func open_gate() -> void:
gate_events.search_pressed_emit(url)
if Url.is_valid(url):
release_focus()
gate_events.open_gate_emit(url)