Generate Sharing-Screen
ReferralHero provides a function to generate the Sharing Screen of the Dashboard Widget. Before generating the Sharing Screen, it's essential to identify the subscriber. Once the subscriber is identified, you can use the following method:
Generating the sharing screen manually can be advantageous in scenarios where you want to control exactly when and where the sharing screen appears. For instance, you might want to display the sharing screen after a user has completed a specific action, such as signing up or purchasing a product, or when they click a button.
Steps to Implement
Identify the Subscriber: Ensure that the subscriber is identified using the
RH_MFxxxxxxxxxx.form.submit()
orRH_MFxxxxxxxxxx.identify()
method.Generate the Sharing Screen: Call the
RH_MFxxxxxxxxxx.generate.sharing_screen()
method to create the Sharing Screen HTML element.Append the Sharing Screen to Your Page: You can append the generated Sharing Screen to any element on your webpage, such as a
div
container. This will make the Sharing Screen visible to your users.
Example Implementation
Here's an example of how to display the Sharing Screen within a div
element with the ID sharing-screen
:
Replace the MFxxxxxxxxxx
with your specific campaign UUID.
Displaying the Sharing Screen in a Popup
To display the sharing screen in a popup, you can call the following function:
This command will create the sharing screen and display it inside a popup window. This approach is useful for keeping your page clean and only showing the sharing options when necessary.
Example: Triggering the Popup on a Button Click
If you want to display the sharing screen when a user clicks a button, you can implement it like this:
Practical Use Case
This approach is perfect for scenarios where you want to offer a clean and focused user experience by only showing referral options when a user is ready, such as after completing a purchase or signing up for a service. It ensures that the sharing screen doesn't clutter the page and only appears when needed.
Last updated