Skip to main content
Installation of Rayn JS
Niels Baarsma avatar
Written by Niels Baarsma
Updated over a week ago

Rayn JS

Whether you have a web app with multiple pages where each one triggers a new page refresh or a single page application you will most likely need the Javascript tag. To install Rayn JS, you will only need to following steps.

How to Install

This guide we will take you through the steps to install the Rayn on your page.

To implement Rayn on your website a single tag needs to be placed in the <HEAD> of your website.

  1. Download the Rayn Wrapper Tag from the Console.

  2. Copy the Wrapper Tag and paste it in the <head> on every page of your website where you wish to work with Rayn.

To get Rayn to function on your web app simply copy and paste the snippet below on every single page on your site where you want the Rayn data to be available.

Copy the following script and paste it as close to the opening <head> tag as possible on every page of your website, replacing XXXXXX with your App ID.

Sample of the Rayn Wrapper Tag:

<script src="https://wrappers.prod.rayn.io/connections/{XXXXXX}/bundle.js" type="module"></script>

Installing Rayn using the wrapper tag is recommended as it will ensure that you will always have the most up to date version of Rayn on your site. Alternatively it is possible to install Rayn directly on your page.

Why does Rayn have to be placed on every single page of my site?

Rayn data will be made available on every page where the tag is present. It is not a requirement to have Rayn on every single page on your site.

Now you should be all set.

Enable logging

Rayn JS can print logs to the browser console which will provide valuable insights on the functioning of the library for troubleshooting purposes. Simply add a query parameter to the url of a given page.

Example: www.google.com/?rayn-log=all

Querystring parameter

Description

?rayn-log=all

Returns all logs.

?rayn-log=info

Returns only the Info logs

Note

Ensure that you allow "Verbose" messages in the browser console to see the detected content categories and cohorts.

Example:

demo site logging.png
Did this answer your question?