mHub Cloud as a proxy
As an alternative to its main use case, mHub Cloud can also be used as a simple proxy for forwarding events to specific platforms, without using its full functionality. Although a significant part of the features of mHub Cloud is not taken advantage of with this approach, it nevertheless offers users the option to exert greater control over the data that is sent to third-party platforms, such as Google Analytics or Facebook.
Taking Google Analytics as an example, the standard approach to sending data consists of HTTP requests being made from the website's front end to Google servers. Among other pitfalls of this means of event collection, sending data to Google directly means that the user has no control over what is and is not sent. In the current climate of discussions about online privacy, this is potentially highly problematic. Already, data privacy authorities, such as the French CNIL, have recommended the use of proxy servers for sending analytical data to Google Analytics.
mHub Cloud, among its other features, facilitates exactly this middle step through its proxy feature. Instead of sending HTTP requests directly to the given analytical platform, the website sends an identical request to the mHub Cloud proxy endpoint. mHub Cloud then collects and processes the request as an event, which is used to create a request to the given third-party platform. By its very nature, this process blocks the IP address of the original user from being sent to the platform. Instead, the IP address sent to the platform belongs to the server where the given mHub Cloud instance is running (see image below). However, further modification of the event parameters is also possible in cases where greater discretion needs to be taken with regards to user privacy.
Overall, the mHub Cloud proxy function allows for a safe and streamlined way to manage data that is sent to third-party platforms while ensuring a 1:1 ratio of sent events compared to sending data directly, and empowering mHub Cloud users to exercise control over their analytical data to the fullest extent.
If you have any questions about this feature, or the possibility of tailoring data sent to third-party platforms to your needs, do not hesitate to contact us at info@mhubcloud.com.
Setting up the proxy
The premise of event processing through the mHub Cloud proxy is relatively simple. Typically, events are collected from a website using an HTTP request to a given platform. When using mHub Cloud as a proxy, all you need to do is to send an identical request (containing the same query, payload, and headers) to the proxy endpoint of the mHub Cloud subdomain for your instance. Below is an illustration comparing a regular request to Google Analytics (upper) and a request to the mHub Cloud proxy endpoint (lower).
While there are some differences between the requests, such as the Tag ID, the information that is relayed in both of them is identical.
Proxy via Google Tag Manager
If you are using Google Tag Manager for measurement on your website, the proxy collection setup is very simple. In the case that you are already sending events via GTM, you only need to modify your existing tag slightly. If you have not set up a GTM tag yet, you will need to create a new one. In both cases, the tag should follow the Google Tag template and retain most of the default settings. The only parameter you will need to adjust is found in the configuration settings section. There, you need to specify server_container_url: the value should call the mHub Cloud subdomain on your website, specifically the api/proxy endpoint. The tag should look like the example below.
This guide assumes you have already completed the collect function initialisation and set up your domains. If that is not the case, please refer to this guide.
Provided you are using a pre-existing tag, your events should now be forwarded to the proxy endpoint. In the case that you have set up a new tag, you need to set up the events you want to send using the new tag. Make sure the measurement ID matches the ID of the tag you have created.