You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-14Lines changed: 19 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,5 @@
1
1
2
+
2
3
# Quiver Analytics
3
4
[Quiver Analytics](https://quiver.dev/analytics/) allows you to collect analytics for games made with the [Godot engine](https://godotengine.org) in a privacy-friendly way. In just a few minutes, you can integrate Analytics in your game through this open source plugin and gain valuable insight into how players are interacting with your game. You also have fine-grained control over how your players' privacy is handled.
4
5
@@ -36,44 +37,48 @@ By default, player consent isn't required for anonymous data collection, but if
36
37
37
38
### Cleaning up before exiting the game
38
39
39
-
Before you quit the game, you have to tell the plugin to send a configurable "Quit game event" and flush any outstanding events. To do that, write this code anywhere you are exiting the game:
40
+
Before you quit the game, you can tell the plugin to send a configurable "Quit game" event and flush any outstanding events. To do that, write this code anywhere you are exiting the game:
40
41
41
42
`await Analytics.handle_exit()`
42
43
43
44
Note that SceneTree.quit() will immediately exit the game so you want to make sure you wait for the above call to finish before calling the quit() function.
44
45
46
+
#### _Note for web and mobile games:_
47
+
48
+
If you are developing a web or mobile game, it might be difficult to call `handle_exit()` since you don't always have the option to run operations when a player backgrounds the app or closes the tab. To work around this, we have added some special logic to automatically add 'Quit game' events. Note that the timing of this event is an estimate and might be up to a minute off the actual quit time.
49
+
45
50
## Advanced Usage
46
51
The following is not required, but you do have additional functionality if you need it.
47
52
48
53
### Managing consent
49
54
50
55
By default, the plugin won't ask for consent since no personally-identifying information is collected. However, you can enable opt-in data collection by going to Project Settings -> Quiver -> Analytics and set "Player Consent Required" to true. Now calls to `add_event()` will be ignored until you obtain consent. To manage consent, you can either use the built-in UI:
51
56
52
-
if Analytics.should_show_consent_dialog():
53
-
Analytics.show_consent_dialog(parent_node)
57
+
if Analytics.should_show_consent_dialog():
58
+
Analytics.show_consent_dialog(parent_node)
54
59
55
60
This will decide whether consent has already been granted or denied and, if not, will spawn a consent dialog as a child of the parent_node.
56
61
57
62
If you'd like to use your own UI and manually handle consent management, you can use the following functions:
58
63
59
-
# Variable storing whether consent has been requested
60
-
Analytics.consent_requested
61
-
# Variable storing consent status
62
-
Analytics.consent_granted
63
-
# Function to call if consent was granted
64
-
Analytics.approve_data_collection()
65
-
# Function to call if consent was denied
66
-
Analytics.deny_data_collection()
64
+
# Variable storing whether consent has been requested
65
+
Analytics.consent_requested
66
+
# Variable storing consent status
67
+
Analytics.consent_granted
68
+
# Function to call if consent was granted
69
+
Analytics.approve_data_collection()
70
+
# Function to call if consent was denied
71
+
Analytics.deny_data_collection()
67
72
68
73
### Customizing consent UI
69
74
By default, the built-in consent UI will use whatever UI theme that has been set for your project. You can modify this by changing the properties of the ConsentDialog found in `/addons/quiver_analytics/consent_dialog.tscn`.
70
75
71
76
### Advanced Properties
72
77
If you turn on Advanced Settings for Project Settings -> Quiver -> Analytics, you'll find the following properties:
73
78
74
-
Config File Path: where the config file is stored
75
-
Auto Add Event on Launch: whether a "Launched game" event is sent automatically when the game starts
76
-
Auto Add Event on Quit: whether a "Quit game" event is sent automatically after calling the `Analytics.handle_exit()` function.
79
+
* "Config File Path": where the config file is stored
80
+
* "Auto Add Event on Launch": whether a "Launched game" event is sent automatically when the game starts
81
+
* "Auto Add Event on Quit": whether a "Quit game" event is sent automatically.
0 commit comments