Main Implementation
Last updated
Was this helpful?
Last updated
Was this helpful?
Property ID - You will need this to set up your script correctly. Contact your account manager to obtain it.
Download the GTM container here.
Go to your GTM (at https://tagmanager.google.com/ )
Go to Admin tab select “Import container”, select the container file you have downloaded. Select the workspace you want to import to and set “merge” option - as on the picture bellow.
Go to section “Variables”
Click on roivenue.tracking.config
and change the values in the JSON object:
property_id
- Insert a Property Id provided by your account manager
api_url
- Should be "https://tr.roivenue.com” unless you implement a custom tracking domain. In that case, change the parameter accordingly.
currency_code
- the default currency code that will be used for tracking purchases used in case that the currency is not specified in purchase object
event_types
- List of dataLayer events that are automatically being captured when the measurement tag is triggered. More about possible changes in the Capturing Events section. Remember that you still need to set the tag triggers!
Navigate to Tags section.
Select roivenue.tracking
code.
Go to the section “Triggering” and add all triggers when you want Roivenue Measurement script to run
Important - This is a frequently missed step
When a user visits your page for the first time, he is probably presented with a cookie banner. You need to send an event immediatelly after they interact with the cookie banner! If you send a next event only after they go to next page, you lose the source of the visit forever and as a result you will not know what was the original source of a conversion when they make a purchase in the future.
The expected additional triggers are those which fire on all of your conversion events and also a trigger indicating a change in consent from a visitor. (By including this, you can switch between cookie and anonymous tracking within one session, if the consent is collected after the start of that session.)
By default these event types are being tracked automatically:
page_view
conversion
purchase
ecomm_purchase
The default configuration works for most businesses. If you need to customize the behavior or change how events parameters are defined, you will find more details in separate pages for custom pageview tracking and custom conversion tracking.
The User ID should not be a personal sensitive information. For privacy protection reasons it is recommended to use an artificial identifier or a hash.
In case you would like to track more conversions than just a purchase or you are sending purchases to your dataLayer
in a format which is different from the example above, you can.
If you want to send additional conversion, these are the parameters you need to send in the conversion event:
conversionType
- What type of conversion it is.
converisonValue
- the value without tax in specified currency
currencyCode
- Three letter ISO-4217 code of currency
conversionId
- an optional parameter which we recommend using in case you want to identify unique conversions later.
If you already have some conversion event object in dataLayer, but the event or some of its parameters are named differently, there is an option how to use these in Roivenue Measurement. The recommended way is described in the Translation Tags page.
By default the Roivenue Measurement is enabled only when consent with analytical cookies has been set via tag manager. If you want to measure in a cookieless mode, you need to modify the tag consent settings.
If you decide to make the tag enabled regardless of GTM consent, set the tag’s Consent Settings / Additional Consent Checks to “Not set” and use consents from any other source.
By default when Roivenue Measurement tag is triggered, It automatically reads the consent settings from dataLayer and use different persistence settings based on setting of analytics_storage
consent variable.
You should always set up your consent to be pushed to dataLayer as well. It is possible that your CMP updates information in Google Tag Manager that the analytics_storage
has been granted but does not push this information to dataLayer. In such case, Roivenue Measurement tag will measure but will measure in anonymous mode without cookies. Which can produce less precise results.
Go to Variables.
Open the roivenue.tracking.enabled
Set up the variable in a way that it will return “True” in case the visitor should be tracked (either in a cookie mode or anonymous mode, this will be set up later). In a case you want to completely exclude user from tracking, this variable should return “False”
Open the roivenue.tracking.persistence
variable.
Set it up in a way it returns localStorage+cookie
in case you want to measure a user using cookies. If you want to measure this user in an anonymous mode, this variable should return sessionStorage
.
When a user changes his consent, you should reflect this change in the value returned by roivenue.tracking.persistence
and potentially also in the roivenue.tracking.enabled
depending on your implementation.
You are using a custom consent management system and because of that, the steps above are more generic and you need to implement it using outputs from that CMS.
As we only act as a data processor, you are responsible for setting up the Roivenue Measurement in line with applicable legislation in your country.
This section is relevant to you only in case your page consists of multiple subdomains. For example: yourshop.com for the store and checkout.yourshop.com for the checkout.
with enabled cookeis, then the events will be connected a single visit. But if user does the same in cookieless mode, there would be a second visit at checkout.yourshop.com and all conversions then would be tracked with www.yourshop.com as a referrer traffic source.
To prevent this:
1. Set write_cross_domain_info
in roivenue.measuerement.config to true
.
A referrer policy needs to be set to allow this mechanism to work.
Roivenue platform uses PostHog for analytics. PostHog is licensed under the MIT License. For more details, please see PostHog's GitHub repository or the full MIT License text.
More about referrer policy: Referrer-Policy - HTTP | MDN