Installing UserReport script on website
How to install the UserReport script on your website
In order for UserReport to work on your website you must install the small UserReport JavaScript.
When you add your website to your UserReport account, you get a UserReport script that is unique to your website.
The script will be send to you by e-mail automatically but you can also find the script in the “settings” menu under “website details” at your UserReport account.
The UserReport script looks something like this:
<script type="text/javascript">
var _urq = _urq || [];
_urq.push(['initSite', '2abf15ce-d983-4c79-a2e9-a8073924d6xx']);
(function() {
var ur = document.createElement('script'); ur.type = 'text/javascript'; ur.async = true;
ur.src = 'http://sdscdn.userreport.com/userreport.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ur, s);
})();
</script>
You will have to paste the script into the template of every page on your site right above the html </HEAD> tag. It is very simple, if you know how to work with HTML and templating. On most website you just have to paste the script into one single template in order for the script to appear on all pages of the website.
If you already have installed Google Analytics on your website, you will know how to handle this task. The Javascript from UserReport is usually installed in the exact same way and place as the Google Analytics script.
Let us presume your website looks something like this:
<html>
<head>
<title>Title of my website</title>
</head>
<body>
Content of my website
</body>
</html>
After inserting the UserReport script it should look like this:
<html>
<head>
<title>Title of my website</title>
<script type="text/javascript">
var _urq = _urq || [];
_urq.push(['initSite', '2abf15ce-d983-4c79-a2e9-a8073924d6xx']);
(function() {
var ur = document.createElement('script'); ur.type = 'text/javascript'; ur.async = true;
ur.src = 'http://sdscdn.userreport.com/userreport.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ur, s);
})();
</script>
</head>
<body>
Content of my website
</body>
</html>
It is important to add the script to all pages of your website. If you are using templates or “includes” in your webdesign, it is recommended that the script is added in this template.
Note: If you are note able to place the UserReport script in the <HEAD> section of the website, you may place it in the <BODY> section instead.
Test it: It’s very easy to test if your implementation works! Simply put ?__urp=test_invite after your website URL in the browser – like http://www.mywebsite.com/?__urp=test_invite
This will open your website and force the survey to appear for testing purposes – if you have implemented the script correctly. Please note that the survey runs in demo-mode when forcing it to appear using this method. This means that answer won’t be saved.
