Difference between revisions of "Flurry.logEvent"

From GiderosMobile
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
<languages />
+
'''Available since:''' Gideros 2011.6<br/>
'''<translate>Available since</translate>:''' Gideros 2011.6<br/>
+
'''Class:''' [[Flurry]]<br/>
'''<translate>Class</translate>:''' [[Special:MyLanguage/flurry|flurry]]<br/>
+
 
=== <translate>Description</translate> ===
+
=== Description ===
<translate>Use this function to count the number of times certain events happen during a session of your application and to pass dynamic parameters <br />
+
Use this function to count the number of times certain events happen during a session of your application and to pass dynamic parameters to be recorded with that event.
to be recorded with that event. Event parameters is optional and can be passed in as a table value. Your application is currently limited to counting <br />
+
<syntaxhighlight lang="lua">
occurrences for 100 different event ids (maximum length 255 characters). Maximum of 10 event parameters per event is supported.<br />
+
flurry.logEvent(eventName,parameters,timed)
<br />
+
</syntaxhighlight>
To start a timed event, pass ''timed'' parameter as ''true''.<br />
+
 
<br /></translate>
+
Event ''parameters'' is optional and can be passed in as a table value. Your application is currently limited to counting occurrences for 100 different event ids (maximum length 255 characters). Maximum of 10 event parameters per event is supported.
<source lang="lua">
+
 
flurry.logEvent(eventName,parameters,timed)
+
To start a timed event, pass ''timed'' parameter as ''true''.
</source>
+
 
=== <translate>Parameters</translate> ===
+
=== Parameters ===
'''eventName''': (string) <translate>The event name to be logged at Flurry service.</translate> <br/>
+
'''eventName''': (string) the event name to be logged at Flurry service<br/>
'''parameters''': (table, optional) <translate>Optional paramaters to be recorted with this event.</translate> <br/>
+
'''parameters''': (table, optional) optional parameters to be recorded with this event<br/>
'''timed''': (boolean, optional) <translate>Specifies this is a timed event.</translate> <br/>
+
'''timed''': (boolean, optional) specifies this is a timed event<br/>
=== <translate>Examples</translate> ===
+
 
'''Example'''<br/>
+
=== Examples ===
<source lang="lua">flurry.logEvent(&quot;myEvent1&quot;)
+
<syntaxhighlight lang="lua">
flurry.logEvent(&quot;myEvent2&quot;, {key=&quot;value&quot;})
+
flurry.logEvent("myEvent1")
flurry.logEvent(&quot;myEvent3&quot;, {key=&quot;value&quot;}, true)</source>
+
flurry.logEvent("myEvent2", { key="value" } )
 +
flurry.logEvent("myEvent3", { key="value" }, true)
 +
</syntaxhighlight>
 +
 
 +
'''You can log events in key parts of your game'''
 +
<syntaxhighlight lang="lua">
 +
local function Level1()
 +
flurry.logEvent("Level1")
 +
--flurry.logEvent( "Level1", { difficulty="Easy", lives=3 } )
 +
 
 +
--Level1 code...
 +
end
 +
 
 +
Level1()
 +
</syntaxhighlight>
  
 
{{Flurry}}
 
{{Flurry}}

Latest revision as of 21:27, 7 December 2023

Available since: Gideros 2011.6
Class: Flurry

Description

Use this function to count the number of times certain events happen during a session of your application and to pass dynamic parameters to be recorded with that event.

flurry.logEvent(eventName,parameters,timed)

Event parameters is optional and can be passed in as a table value. Your application is currently limited to counting occurrences for 100 different event ids (maximum length 255 characters). Maximum of 10 event parameters per event is supported.

To start a timed event, pass timed parameter as true.

Parameters

eventName: (string) the event name to be logged at Flurry service
parameters: (table, optional) optional parameters to be recorded with this event
timed: (boolean, optional) specifies this is a timed event

Examples

flurry.logEvent("myEvent1")
flurry.logEvent("myEvent2", { key="value" } )
flurry.logEvent("myEvent3", { key="value" }, true)

You can log events in key parts of your game

local function Level1()
	flurry.logEvent("Level1")
	--flurry.logEvent( "Level1", { difficulty="Easy", lives=3 } )

	--Level1 code...
end

Level1()