M
O
O
N
I
T
O
Integrate Analytics with Embedded Code
Here is the documentation guide on integrating Analytics feature into any web application.
- First, sign up for the domain you want to protect and learn about its visitors on the Analytics page.
- Then, type in your website address and choose the security options you prefer. After that, click
Submit
and you'll be taken to theInsert Code
page where you'll see a code displayed below:
<script defer data-public-key="2Q4FnwYy6gaOY70F9GVxMNxxxxxxxxxx" data-blocked-page="//google.com" src="https://cdn.jsdelivr.net/gh/moonito-net/lib/analytics.min.js"></script>
- Copy the code and paste it into every page (or into the master template) of your website just before the closing
< /head>
tag. Make sure to update the value ofdata-blocked-page
with the URL to which you want to redirect unwanted visitors. By default, unwanted visitors will be directed to https://google.com.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Your Web Application</title>
<!-- Include Embedded Code -->
<script defer data-public-key="2Q4FnwYy6gaOY70F9GVxMNxxxxxxxxxx" data-blocked-page="//google.com" src="https://cdn.jsdelivr.net/gh/moonito-net/lib/analytics.min.js"></script>
</head>
<body>
<!-- Your web application content goes here -->
</body>
</html>
- Do some testing. Open your website, the embedded code will run when the page loads and making a request to the analytics endpoint.
- For information regarding visitor statistics, you can go to the Analytics page for details.