The marketing API allows you to handle promotional features such as subscribing the user to your newsletters.
Before using the marketing SDK, you must define mailing lists for your organization. You can do so by visiting the Mailing Lists tab of the Edit Organization page.
A mailing list requires 3 fields:
All the methods of this API are accessible via the heyVR.marketing
object, which is made accessible to your game automatically.
To abide GDPR regulations, the user must confirm their subscription via an email (automatically sent by the system). If the user has already confirmed their email address, no further confirmation is required.
You can subscribe a user to a specific mailing list. This way, you can track which user has subscribed to which listing.
To do so, simply call the following method:
heyVR.marketing.subscribe( slug: string ) : Promise<true>;
slug
: The subscription ID/slug to subscribe to.Promise
that resolve to true if the action is successful, or rejected in case of network failure.To unsubscribe a previously subscribed user from a mailing list, you can call the following method:
heyVR.marketing.unsubscribe( slug: string ) : Promise<true>;
The user does not need to be subscribe to the game before calling this method, so you can safely call it regardless of the subscription status.
slug
: The subscription ID/slug to unsubscribe from.Promise
that resolve to true if the action is successful, or rejected in case of network failure.You can check whether the user is subscribed to a specific mailing list or not. You can use this to adjust your UI based on the current statue of the subscription:
heyVR.marketing.isSubscribed( slug: string ) : Promise<boolean>;
slug
: The subscription ID/slug to check the subscription of.Promise
that resolve to true if the user was already subscribed, or false if the user was not already subscribed. Rejected in case of network failure.