Type Function Return value none Revision Release 2025.3721 Keywords ads, advertising, monetization, fuse, register See also fuse.*
Registers user properties with the Fuse tracking system, for example the user’s level, amount of virtual currency, actual age/gender, etc. By creating distinct zones within the Fuse dashboard, you may target users based on specific registered criteria.
fuse.register( propertyType [, params] )
String. Specifies the type of property to register. Valid options include:
"currency" — Register a currency type and its current balance."level" — Register the user’s level."gender" — Register the user’s gender."age" — Register the user’s age."birthday" — Register the user’s birthday."parental" — Register the user’s parental consent status."virtualGoodsPurchase" — Register a virtual goods purchase."rewardedVideo" — Optional custom account ID for rewarded video server verification."custom" — Register unique information on a per-user basis."pushToken" — Requests user authorization for push notifications.Table. Table which specifies optional parameters — see the next section for details.
The params table should include key-value pairs associated with the propertyType being registered.
Fuse supports up to 4 different types of virtual currencies per app, each associated with an integer between 1 and 4. These currencies should represent consumable items like tokens, coins, diamonds, etc. For example, “coins” may be represented by the integer 1 and, by calling fuse.register() within the game, you may register when the user has earned 2000 coins.
The following key-value pairs pertain to registering virtual currency:
level — Required number indicating the user’s level.gender — Required string value of "male" or "female".age — Required number indicating the user’s age.consent — Required boolean value of true indicating that the user’s parent had consented.virtualGoodsId — Required number identifying the virtual good, found on the Fuse dashboard. If the purchase was initiated with event.type of "rewarded", this parameter should be the same as the offerObjectID property of event.payload.currencyId — Required number indicating the currency used, found on the Fuse dashboard.amount — Required number indicating the amount of currency spent.eventId — Required number identifier of the event to register. This should be an integer between 1 and 20 inclusive. Event numbers 1-10 are reserved for integers and event numbers 11-20 are reserved for strings.value — Required number or string depending on the eventId parameter.Example properties you should track for custom integer type events:
Example properties you should not track for custom integer type events:
Example properties you should track for custom string type events:
Example properties you should not track for custom string type events:
No additional parameters are necessary for this property type — simply submit "pushToken" as the propertyType parameter. Then, to enable push notifications, follow the instructions related to push notification setup outlined in the Local/Push Notifications guide, depending on the platforms you want to support.
local fuse = require( "plugin.fuse" )
-- Event listener function
local function adListener( event )
if ( event.isError ) then
print( "Fuse error: " .. event.response )
else
if ( event.phase == "init" ) then
-- Fuse system initialized
end
end
end
-- Initialize the Fuse service
fuse.init( adListener )
-- Register a currency type/balance
fuse.register( "currency", { currency=1, balance=200 } )
-- Register user's level
fuse.register( "level", { level=4 } )
-- Register user's gender
fuse.register( "gender", { gender="female" } )
-- Register user's age
fuse.register( "age", { age=32 } )
-- Register user's birthday
fuse.register( "birthday", { day=2, month=8, year=1982 } )
-- Register the user's parental consent status
fuse.register( "parental", { consent=true } )
-- Register a virtual goods purchase
fuse.register( "virtualGoodsPurchase", { virtualGoodsId=123456, currencyId=987, amount=50 } )
-- Register user's customization color
fuse.register( "custom", { eventId=12, value="Blue" } )
-- Request user authorization for push notifications
fuse.register( "pushToken" )