Configuration file
Behind the scenes, ReferralHero uses a configuration file that contains all the properties of your campaign (eg: the colour of the button, the text in the header, which social buttons to show, etc).
You can manually override every single setting by using a custom configuration file. To do so, simply instantiate a global window.RHConfig object BEFORE the Tracking Pixel.
The custom Configuration file must be instantiated before the Tracking Pixel or else it won't work.
This is useful when you want to change something (ie: the header or the colour of the button) "on-the-fly" or or only on specific pages. Please be aware that you don't need to specify every single property. Simply add the settings that you want to change and ReferralHero will use your campaign defaults for the other settings.
Below you can see the ReferralHero configuration file. Most properties are obvious, for others we have added a short description.
1
<script type="text/javascript">
2
window.RHConfig = {
3
defaults: {
4
form_container_id: "maitre-widget", // The ID of the div where you want the form to appear.
5
sharing_screen_container_id: "maitre-sharing", // The ID of the div where you want the sharing screen. Useful only if you want the sharing screen to appear in a different part of the page. It doesn't work if the popup is enabled
6
default_url: "http://referralhero.com", // The URL that will be used to create the referral link.
7
source: "Twitter", // The marketing channel the subscribers will be attributed to.
8
email: "[email protected]", // The default value of the email field.
9
name: "John Smith", // The default value of the name field.
10
extra_field: "USA", // The default value of the extra_field field.
11
extra_field_2: "+1 123456789" // The default value of the second extra_field field.
12
},
13
settings: {
14
track_events: false, //If custom events can be tracked
15
one_click_signup: {
16
enable: true, // Turn on/off the one-click-signup feature
17
name: "rh_name",
18
email: "rh_email", // The URL parameter used to extract the email
19
extra_field: "rh_extra_field",
20
extra_field_2: "rh_extra_field_2"
21
},
22
floating_button: {
23
enable: true, // Whether or not to enable the Floating Button
24
text: "Join our Ambassador Program",
25
color: "#1781bb",
26
position: "left" // Can be "left", "center" or "right"
27
},
28
design: {
29
enable: true, // If disabled, the form will be loaded without a stylesheet
30
custom_css: "",
31
colors: {
32
primary: "#1781bb"
33
}
34
},
35
form: {
36
cover: "https://mywebsite.com/images/cover.jpg",
37
header: { text: "Sign up to win", color: "#1781bb" },
38
name: { require: true, placeholder: "Your name" },
39
email: { placeholder: "Your email" },
40
extra_field: { require: false, placeholder: "" },
41
extra_field_2: { require: false, placeholder: "" },
42
submit_button: {
43
text: "Submit",
44
check_position: "Check status",
45
submitting: "Submitting...",
46
color: "#1781bb"
47
},
48
status: { text: "Check status", back: "Back" },
49
terms_conditions: {
50
require: true,
51
text: "I accept the terms and conditions",
52
url: "https://mywebsite.com/legal/terms"
53
}
54
},
55
sharing: {
56
redirection: {
57
enable: false, // Enabele/disable redirectoin after sign up
58
url: ""
59
},
60
popup: false,
61
open_if_signed_up: true,
62
header: { text: "Congratulations, you're in!", color: "#222" },
63
subheader: {text: "", color: "#bbb" },
64
people_referred: { show: true, text: "Your referrals" },
65
position: { show: true , text: "Your position", ordinal: true },
66
instructions: "Refer your friends with the link below",
67
referral_link: { copy_button: "Copy", copied_button: "Copied" },
68
verification: {
69
text: "Don't forget to confirm your email",
70
reminder_email: "Your email hasn't been verified yet.<br>Check your inbox - including the junk folder - and if you don't find it click the link below to resend it.",
71
resend_email: "Resend confirmation email",
72
resending_email: "Sending email...",
73
email_replace: "confirm your email", // The string that will be replaced with a link to popular email providers. Try to signup with a @gmail.com email.
74
email_resent: "Email has been sent. Check your inbox."
75
},
76
socials: {
77
twitter: { show: true, message: "I just signed up on this awesome website! %referral_code%" },
78
facebook: { show: true },
79
facebook_messenger: { show: false },
80
email: { show: true, message: "Check this out %referral_code%", subject: "" },
81
whatsapp: { show: false, message: "" },
82
linkedin: { show: false, message: "" },
83
reddit: { show: false, message: "" },
84
telegram: { show: false, message: "" },
85
line: { show: false, message: "" }
86
},
87
leaderboard: {
88
show: true,
89
position: "Position",
90
subscriber: "Subscriber",
91
points: "Points",
92
footnote: "1 referral = 1 point"
93
},
94
rewards: {
95
header: "This is what you can win",
96
list: [
97
{ title: "Free Hat", description: "1st position", image: "https://mywebsite.com/images/reward.png" },
98
{ title: "Free Suite", description: "2nd position", image: "https://mywebsite.com/images/reward.png" }
99
],
100
referrals: "Referrals",
101
unlocked: "Unlocked!"
102
}
103
},
104
alerts: {
105
subscriber_not_found: "Email not found.",
106
subscriber_already_promoted: "You have already been promoted.",
107
form_incomplete: "Something is missing. Please fill out the form before submitting.",
108
server_problem: "We are experiencing some issues on our server. Please try again.",
109
failed_recaptcha: "It looks like you're a bot.",
110
terms_conditions: "You must accept the Terms & Conditions",
111
}
112
},
113
callbacks: {} // See Callbacks article
114
}
115
</script>
Copied!
Last modified 1yr ago
Copy link