Implementation without GTM
This manual describes how to implement Roivenue Measurement in your web that does not use Google Tag Manager.
Prerequisites
Property ID - You will need this to set up your script correctly. Contact your account manager to obtain it.
Visits tracking on all pages
Insert this entire code on every page inside
<head> </head>element.
<!-- BEGIN Roivenue Measurement -->
<script>
var rm_config = {
property_id : "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
api_url: "https://tr.roivenue.com",
autocapture: true
};
</script>
<script src="https://tr.roivenue.com/static/init_v2.js"></script>
<!-- END Roivenue Measurement -->
Adjust the
property_id- insert the ID you have from your account manager.
Start Tracking Events
To start tracking events, call the
startMeasurementfunction of the global$rmobject:
Disabling measurement
Once measurement has been started by calling $rm.startMeasurement() it is enabled and captures all events. Measurement can then be stopped by calling $rm.stopMeasurement().
$rm.stopMeasurement();
Calling this method disables measurement and no further events will be captured even when calling $rm.capture() or $rm.identify().
Configuration of Consent and Anonymous Tracking
If you have a full consent from your website visitor, we recommend using the default settings of
persistence.When there is a limited consent with tracking, you should set up
persistencetosessionStorage
To completely exclude user from tracking, the
startMeasurementfunction should not be called at all.
Additional Settings for Anonymous Tracking with Multiple domains
You need to configure a property in the
rm_configobjectwrite_cross_domain_info- By default, it is set tofalse,change it totrueThe session id will be inserted into the URL of the current web page and will be passed as a referrer URL to subsequent web pages.
You need to insert a following meta tag for referrer policy into the source web page:
<meta name="referrer" content="no-referrer-when-downgrade" />This step makes it possible to pass the full URL in the referrer URL.
The destination web page automatically reads the session id from the referrer URL.
The destination web page automatically reads the session id from the referrer URL.
Conversions Tracking
Next, we need to capture all conversions created by your customers.
To do that, call capture conversion to track an e-commerce purchase event:
Multiple Conversions Setup
To track other conversion type events, you can easily track a ‘conversion’ event exactly the same as described above and just change the conversionType.
User Identification
We can use User ID to track users across devices. This ID is typically available only for users which logged in on your website.
Whenever the user logs in or makes a purchase that you are able to connect with a unique user identifier, call this:
Additional Changes for Single Page Applications
Set the
rm_config.autocapturetofalseon all pages.To track pageviews, call capture function after every navigation (when page location changes):
Last updated
Was this helpful?