{"id":27069,"date":"2025-01-14T21:48:55","date_gmt":"2025-01-14T21:48:55","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/ga4-to-piwik-pro-using-server-side-google-tag-manager\/"},"modified":"2025-01-14T21:48:55","modified_gmt":"2025-01-14T21:48:55","slug":"ga4-to-piwik-pro-using-server-side-google-tag-manager","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=27069","title":{"rendered":"GA4 to Piwik PRO Using Server-side Google Tag Manager"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div>\n<p>There are <strong>two<\/strong> new <a href=\"https:\/\/www.simoahava.com\/analytics\/custom-templates-guide-for-google-tag-manager\/\">custom templates<\/a> available in <strong>server-side Google Tag Manager<\/strong>. These templates have been designed to facilitate <a href=\"https:\/\/piwik.pro\/\">Piwik PRO<\/a> tracking in a server-side container.<\/p>\n<ol>\n<li><strong>Piwik PRO Client<\/strong> -&gt; This <em>Client<\/em> template interacts with the <a href=\"https:\/\/developers.piwik.pro\/en\/latest\/data_collection\/web\/javascript_tracking_client\/index.html\">Piwik PRO JavaScript tracker<\/a> and lets you route Piwik PRO tracking through a server-side GTM container. <a href=\"https:\/\/github.com\/PiwikPRO\/server-side-template-for-gtm-v2-client\">GitHub repo<\/a>.<\/li>\n<li><strong>Piwik PRO<\/strong> -&gt; The <em>tag<\/em> template works in unison with the Piwik PRO Client, forwarding the hits to the Piwik PRO endpoint. <a href=\"https:\/\/github.com\/PiwikPRO\/server-side-template-for-gtm-v2\">GitHub repo<\/a>.<\/li>\n<\/ol>\n<p><a href=\"https:\/\/www.simoahava.com\/analytics\/new-piwik-pro-templates-server-side-google-tag-manager\/\"><em>Read this article to learn more about how these templates work.<\/em><\/a><\/p>\n<p>However, both templates have been built with a universal application in mind. The <strong>Client<\/strong> template produces event data that can be consumed by other vendors\u2019 tags, too. Similarly, the <strong>tag<\/strong> template has been designed so that it can work with other Clients.<\/p>\n<p>In this article, I\u2019ll show you how to <em>quite<\/em> easily take an incoming <strong>Google Analytics 4<\/strong> stream in server-side Google Tag Manager (claimed by the built-in GA4 Client) and map that to a format that can be utilized by the Piwik PRO tag.<\/p>\n<div style=\"aspect-ratio: 1920 \/ 1080;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/ga4-client-to-tags.jpg\" title=\"First approach, GA4 client to tags\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1080\" width=\"1920\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/ga4-client-to-tags.jpg#ZgotmplZ\" alt=\"First approach, GA4 client to tags\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>As the lousy illustration above shows, we\u2019ll use the <strong>GA4 Client<\/strong> to handle the incoming stream, but we\u2019ll then create a <strong>Piwik PRO tag<\/strong> to take the data generated by the GA4 Client and forward it to Piwik PRO servers (in the correct format, of course).<\/p>\n<p>                <span class=\"simmer\"><br \/>\n  <span class=\"close\">X<\/span><\/p>\n<p>\n    <span class=\"fa fa-md fa-bell\"\/><br \/>\n    <strong>The Simmer Newsletter<\/strong>\n  <\/p>\n<p>\n    Subscribe to the <a href=\"https:\/\/www.simoahava.com\/newsletter\/\">Simmer newsletter<\/a> to get the latest news and content from Simo Ahava into your email inbox!\n  <\/p>\n<p>  <\/span><\/p>\n<h2 id=\"getting-started\">Getting started<\/h2>\n<p>To start with, we already have an established data stream for proxying Google Analytics 4 hits through a server-side Google Tag Manager container.<\/p>\n<div style=\"aspect-ratio: 1654 \/ 1376;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/sgtm-setup.jpg\" title=\"SGTM starting point\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1376\" width=\"1654\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/sgtm-setup.jpg#ZgotmplZ\" alt=\"SGTM starting point\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The property collects a variety of Google Analytics 4 data, but we\u2019re going to focus on the following four events in our mapping to Piwik PRO:<\/p>\n<ol>\n<li>The <code>page_view<\/code> event is sent whenever a page is loaded in the browser.<\/li>\n<li>The <code>view_item<\/code> event is sent whenever a product is viewed.<\/li>\n<li>The <code>add_to_cart<\/code> event is sent whenever a product is added to the cart.<\/li>\n<li>The <code>purchase<\/code> event is sent whenever a purchase is completed.<\/li>\n<\/ol>\n<p>This is a very typical <em>business-critical<\/em> event list. To keep things concise in this article, we\u2019ll focus on just these four and ignore the rest when building the mapping to Piwik PRO.<\/p>\n<h2 id=\"how-the-tag-template-works\">How the tag template works<\/h2>\n<p>First of all, remember to <a href=\"https:\/\/www.simoahava.com\/analytics\/new-piwik-pro-templates-server-side-google-tag-manager\/\">read this article<\/a> for a more in-depth exploration of the new Piwik PRO templates.<\/p>\n<p>To get started with the tag template, you need to fill in the <strong>Account Name<\/strong> and the <strong>Site or App ID<\/strong> fields. The values for these fields can be found in your Piwik PRO settings.<\/p>\n<div style=\"aspect-ratio: 1348 \/ 734;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/instance-and-id.jpg\" title=\"Account naem and site or app id\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"734\" width=\"1348\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/instance-and-id.jpg#ZgotmplZ\" alt=\"Account naem and site or app id\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>If you then scroll down the tag template, you\u2019ll find that almost all the fields have a default value of <strong>Inherit from Client<\/strong>.<\/p>\n<p>This means that the field automatically grabs the value from what the server-side Client produced <em>as long as it\u2019s in the correct format<\/em>.<\/p>\n<p>The Piwik PRO Client has of course been built so that it generates the values correctly for the tag, but the <strong>GA4 Client<\/strong> understandably doesn\u2019t consider Piwik Pro\u2019s idiosyncracies in its output.<\/p>\n<h3 id=\"ga4-event-data-mapped-to-piwik-pro-parameters\">GA4 Event Data mapped to Piwik PRO parameters<\/h3>\n<p>Here is the list of fields that the Piwik PRO tag template can read <strong>automatically<\/strong> from the GA4 Client:<\/p>\n<table>\n<thead>\n<tr>\n<th>GA4 Event Data key<\/th>\n<th>Maps to Piwik PRO parameter<\/th>\n<th>Field name in the tag UI<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>page_location<\/code><\/td>\n<td><code>url<\/code><\/td>\n<td>Event URL<\/td>\n<td>The URL of the page where the event happened.<\/td>\n<\/tr>\n<tr>\n<td><code>page_referrer<\/code><\/td>\n<td><code>urlref<\/code><\/td>\n<td>Referrer URL<\/td>\n<td>The referrer of the page where the event happened.<\/td>\n<\/tr>\n<tr>\n<td><code>user_id<\/code><\/td>\n<td><code>uid<\/code><\/td>\n<td>User ID<\/td>\n<td>User ID for logged-in users.<\/td>\n<\/tr>\n<tr>\n<td><code>ip_override<\/code><\/td>\n<td><code>cip<\/code><\/td>\n<td>Override User IP<\/td>\n<td>IP address of the visitor.<\/td>\n<\/tr>\n<tr>\n<td><code>value<\/code><\/td>\n<td><code>revenue<\/code><\/td>\n<td>Revenue<\/td>\n<td>Value of the event (for e-commerce).<\/td>\n<\/tr>\n<tr>\n<td><code>user_agent<\/code><\/td>\n<td><code>ua<\/code><\/td>\n<td>&#8211;<\/td>\n<td>User-Agent string of the user\u2019s browser.<\/td>\n<\/tr>\n<tr>\n<td><code>language<\/code><\/td>\n<td><code>lang<\/code><\/td>\n<td>&#8211;<\/td>\n<td>Browser language.<\/td>\n<\/tr>\n<tr>\n<td><code>screen_resolution<\/code><\/td>\n<td><code>res<\/code><\/td>\n<td>&#8211;<\/td>\n<td>Screen resolution of the visitor\u2019s browser.<\/td>\n<\/tr>\n<tr>\n<td><code>client_id<\/code><\/td>\n<td><code>_id<\/code><\/td>\n<td>Visitor ID<\/td>\n<td>The tag automatically converts the GA4 Client ID to the correct Piwik PRO format (16-character hexadecimal hash).<\/td>\n<\/tr>\n<tr>\n<td><code>page_title<\/code><\/td>\n<td><code>action_name<\/code><\/td>\n<td>Event (Action) Name<\/td>\n<td>With page view hits, the <code>page_title<\/code> is automatically used as <code>action_name<\/code>.<\/td>\n<\/tr>\n<tr>\n<td><code>transaction_id<\/code><\/td>\n<td><code>ec_id<\/code><\/td>\n<td>Order ID<\/td>\n<td>The ID of the transaction.<\/td>\n<\/tr>\n<tr>\n<td><code>items<\/code><\/td>\n<td><code>ec_products<\/code><\/td>\n<td>Products<\/td>\n<td>The GA4 <code>items<\/code> array is automatically converted to the correct <code>ec_products<\/code> format.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>These keys are accounted for by the GA4 Client and the Piwik PRO tag template, so you can leave them with the <strong>Inherit from Client<\/strong> option enabled.<\/p>\n<p>The rest of the parameters that you need to map or generate depend on the event you are collecting. The full inventory of parameters supported by the Piwik PRO servers can be found in their <a href=\"https:\/\/developers.piwik.pro\/en\/latest\/data_collection\/api\/http_api.html\">HTTP API documentation<\/a>.<\/p>\n<p>You can add the missing parameters by editing the Piwik PRO tag fields or by using a <a href=\"https:\/\/www.simoahava.com\/analytics\/transformations-server-side-google-tag-manager\/\">Transformation in SGTM<\/a>.<\/p>\n<h3 id=\"the-rec-parameter\">The \u201crec\u201d parameter<\/h3>\n<p>The tag template sets the <code>rec<\/code> parameter to <code>1<\/code> by default. This means that the request is recorded in your Piwik PRO instance.<\/p>\n<p>If, for some reason, you <em>don\u2019t<\/em> want the hit to be registered in Piwik PRO, you can set <code>rec<\/code> to <code>0<\/code> using the <strong>Additional Parameters<\/strong> field in the tag UI. Any parameters you enter here will override any previous values registered by the tag.<\/p>\n<div style=\"aspect-ratio: 1750 \/ 328;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/additional-parameter.jpg\" title=\"Additional parameter\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"328\" width=\"1750\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/additional-parameter.jpg#ZgotmplZ\" alt=\"Additional parameter\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<h3 id=\"the-_id-parameter\">The \u201c_id\u201d parameter<\/h3>\n<p>Piwik PRO uses a <strong>16-character-long hexadecimal hash<\/strong> as the value of the Visitor ID. This is collected with the parameter <code>_id<\/code>.<\/p>\n<p>The tag template automatically uses the <code>client_id<\/code> value stored in the Event Data object when creating the <code>_id<\/code> value.<\/p>\n<p>To collect the ID in the correct format, the Client ID is first hashed with the SHA256 algorithm and then the first 16 characters are used for the Visitor ID.<\/p>\n<div style=\"aspect-ratio: 1218 \/ 518;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/ga4-client-id-hash.jpg\" title=\"GA4 Client ID hash\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"518\" width=\"1218\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/ga4-client-id-hash.jpg#ZgotmplZ\" alt=\"GA4 Client ID hash\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Of course, you can use your own value for the Visitor ID, but remember that it <strong>must<\/strong> be in the correct format for Piwik PRO to accept it.<\/p>\n<h2 id=\"the-page_view-event\">The page_view event<\/h2>\n<p>We\u2019ll build the mapping event by event, starting with <code>page_view<\/code>.<\/p>\n<p>Create a new Piwik PRO tag in server-side Google Tag Manager, and set the <strong>Account Name<\/strong> and <strong>Site or App ID<\/strong> fields.<\/p>\n<div style=\"aspect-ratio: 824 \/ 330;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/instance-and-id-real-case.jpg\" title=\"Account name and ID\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"330\" width=\"824\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/instance-and-id-real-case.jpg#ZgotmplZ\" alt=\"Account name and ID\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Next, under <strong>Event Configuration<\/strong>, choose <strong>Page \/ App View<\/strong> as the Event Type.<\/p>\n<blockquote>\n<p>This is an optional step, because the tag template sees the <code>page_view<\/code> event and deduces the event type from that. But sometimes the event name doesn\u2019t match the event type, so it\u2019s good to be explicit.<\/p>\n<\/blockquote>\n<div style=\"aspect-ratio: 1018 \/ 714;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/page-app-view.jpg\" title=\"Page \/ App View\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"714\" width=\"1018\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/page-app-view.jpg#ZgotmplZ\" alt=\"Page \/ App View\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Finally, add a trigger to the tag. Focus on the <code>page_view<\/code> event, and for good measure only fire the tag if the <strong>Client Name<\/strong> built-in variable is <code>GA4<\/code>.<\/p>\n<div style=\"aspect-ratio: 1848 \/ 488;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/page-view-trigger.jpg\" title=\"Page view trigger\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"488\" width=\"1848\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/page-view-trigger.jpg#ZgotmplZ\" alt=\"Page view trigger\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Finally, save the tag and go to Preview mode in server-side Google Tag Manager.<\/p>\n<h3 id=\"preview-and-test\">Preview and test<\/h3>\n<p>The first thing we\u2019ll do is send a <code>page_view<\/code> event to server-side Google Tag Manager, select it, and open the Console tab.<\/p>\n<div style=\"aspect-ratio: 2402 \/ 752;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/compiled-body.jpg\" title=\"Compiled request body\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"752\" width=\"2402\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/compiled-body.jpg#ZgotmplZ\" alt=\"Compiled request body\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The Piwik PRO tag outputs this information into the console.<\/p>\n<p>In the <strong>Compiled request body<\/strong>, you should see the <code>action_name<\/code> with the page title. This is important, because this distinguishes the hit as a <strong>page view<\/strong> request.<\/p>\n<p>Check also that you see the <code>_id<\/code> parameter in the request. Copy the value of <code>_id<\/code> to the clipboard.<\/p>\n<p>Next, open the <a href=\"https:\/\/help.piwik.pro\/support\/collecting-data\/tracker-debugger\/\">Tracker Debugger<\/a> in Piwik PRO. Filter the results for the Visitor ID you copied to the clipboard. This is what you should see:<\/p>\n<div style=\"aspect-ratio: 1232 \/ 234;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/tracker-debugger-pageview.jpg\" title=\"Tracker debugger and page view\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"234\" width=\"1232\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/tracker-debugger-pageview.jpg#ZgotmplZ\" alt=\"Tracker debugger and page view\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Everything just \u2026 works! Your Page View hit has all the necessary data included.<\/p>\n<p>You can click the little <code>&gt;<\/code> button next to the <strong>Page view<\/strong> event name to view more details about what was collected. The raw data should match what you saw in the Console tab of server-side Google Tag Manager.<\/p>\n<p>And <strong>that\u2019s it<\/strong> for the page view event! It works! Here\u2019s a recap of what was done:<\/p>\n<ol>\n<li>Create a new Piwik PRO tag.<\/li>\n<li>Fill in the <em>Account Name<\/em> and <em>Site or App ID<\/em> fields correctly.<\/li>\n<li>Trigger the tag on the <code>page_view<\/code> event collected by the GA4 client.<\/li>\n<\/ol>\n<p>Next, let\u2019s do the same for the three e-commerce events.<\/p>\n<h2 id=\"the-product-detail-view-event\">The product-detail-view event<\/h2>\n<p>The GA4 analogy to Piwik PRO\u2019s <code>product-detail-view<\/code> is the <code>view_item<\/code> event.<\/p>\n<p>Let\u2019s follow the same process as above to map this event correctly.<\/p>\n<p>First, we\u2019ll create a new Piwik PRO tag with the <strong>Account Name<\/strong> and <strong>Site or App ID<\/strong> populated.<\/p>\n<p>Now, let\u2019s choose <strong>Ecommerce<\/strong> as the Event Type.<\/p>\n<div style=\"aspect-ratio: 964 \/ 560;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/event-type-ecommerce.jpg\" title=\"Ecommerce event type\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"560\" width=\"964\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/event-type-ecommerce.jpg#ZgotmplZ\" alt=\"Ecommerce event type\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>When you choose this, a new section titled <strong>Ecommerce<\/strong> appears.<\/p>\n<p>Here, the key field is <strong>Ecommerce Event Type<\/strong>. We\u2019ll keep that as <strong>Inherit from Client<\/strong>, but it won\u2019t work properly until we add the relevant field into the Event Data object using a Transformation. We\u2019ll get to this in a bit.<\/p>\n<p>Create a <strong>Custom Event<\/strong> trigger with <code>^(view_item)$<\/code> as the value of the <strong>Event name<\/strong> field, and check <strong>Use regex matching<\/strong>. Add a condition to check for the GA4 Client, same as you did with the Page View tag.<\/p>\n<p>Once ready, save the trigger and add it to the tag.<\/p>\n<div style=\"aspect-ratio: 1764 \/ 874;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/ecommerce-trigger.jpg\" title=\"Ecommerce trigger\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"874\" width=\"1764\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/ecommerce-trigger.jpg#ZgotmplZ\" alt=\"Ecommerce trigger\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>We\u2019re using a regex match for the event name, because we\u2019ll expand this trigger soon with other Ecommerce events.<\/p>\n<p>Finally, save the tag.<\/p>\n<h3 id=\"the-event-type-parameter\">The Event Type parameter<\/h3>\n<p>The Event Type parameter in the Piwik PRO request is <code>e_t<\/code>, and so the name of the field we need to add with a Transformation is <code>x-pp-e_t<\/code> (remember that <code>x-pp-<\/code> is the prefix for all Piwik PRO-specific parameters).<\/p>\n<p>Piwik PRO accepts one of these as the value: <code>order<\/code>, <code>product-detail-view<\/code>, <code>add-to-cart<\/code>, <code>cart-update<\/code>, <code>remove-from-cart<\/code>. In this article, we\u2019ll focus just on the first three.<\/p>\n<p>To make things easier to manage, start by creating a new <strong>Lookup Table<\/strong> variable, where the Input variable is the built-in <code>{{Event Name}}<\/code> variable. Add just one row, which maps <code>view_item<\/code> in the input (the value of <code>{{Event Name}}<\/code>) to <code>product-detail-view<\/code> in the output:<\/p>\n<div style=\"aspect-ratio: 2334 \/ 826;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/event-name-transformation-ecommerce.jpg\" title=\"Event name transformation for ecommerce\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"826\" width=\"2334\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/event-name-transformation-ecommerce.jpg#ZgotmplZ\" alt=\"Event name transformation for ecommerce\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Next, create a new <strong>Augment Event Transformation<\/strong> for Piwik PRO.<\/p>\n<p>Go to <strong>Transformations<\/strong> in the container UI, and click to create a new Augment Event Transformation.<\/p>\n<p>Here, add a new row with <code>x-pp-e_t<\/code> as the Name. Set the Lookup Table variable you just created as the Value.<\/p>\n<div style=\"aspect-ratio: 2130 \/ 1512;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/ecommerce-transformation.jpg\" title=\"Ecommerce transformation\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1512\" width=\"2130\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/ecommerce-transformation.jpg#ZgotmplZ\" alt=\"Ecommerce transformation\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>This Transformation populates the <code>x-pp-e_t<\/code> field with the correct Ecommerce event name <em>if<\/em> the event name is mapped in the Lookup Table.<\/p>\n<h3 id=\"preview-and-test-1\">Preview and test<\/h3>\n<p>Once you\u2019ve created the tag and the trigger and you\u2019ve updated the Transformation, you can go into Preview mode and do whatever it takes to fire a standard <code>view_item<\/code> event to your GA4 Client.<\/p>\n<p>The Piwik PRO tag should fire with the <code>view_item<\/code> event, and you should see something like this in the Console tab with the event selected:<\/p>\n<div style=\"aspect-ratio: 2404 \/ 398;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/product-detail-view-almost.jpg\" title=\"product-detail-view\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"398\" width=\"2404\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/product-detail-view-almost.jpg#ZgotmplZ\" alt=\"product-detail-view\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>When you open <strong>Tracker Debugger<\/strong> in Piwik PRO, you should see this:<\/p>\n<div style=\"aspect-ratio: 1214 \/ 724;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/product-detail-view-debugger.jpg\" title=\"product detail view\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"724\" width=\"1214\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/product-detail-view-debugger.jpg#ZgotmplZ\" alt=\"product detail view\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>The tag template <em>automatically<\/em> mapped the <code>items<\/code> array that the GA4 Client produced into the correct format digested by the Piwik PRO tag (<code>ec_products<\/code>).<\/p>\n<p>Nice, <code>product-detail-view<\/code> works now, too. Here\u2019s what we did:<\/p>\n<ol>\n<li>Create a new Lookup Table that maps GA4 event names to their Piwik PRO counterparts.<\/li>\n<li>Create a new the Augment Event Transformation with Event Type (<code>x-pp-e_t<\/code>), derived from the built-in <code>{{Event Name}}<\/code> variable using the Lookup Table.<\/li>\n<li>Add a trigger to the tag that only fires it when an Ecommerce event occurs (<code>view_item<\/code> in this case).<\/li>\n<\/ol>\n<p>This is getting easier by the event!<\/p>\n<p>Next, <code>add-to-cart<\/code>.<\/p>\n<h2 id=\"the-add-to-cart-event\">The add-to-cart event<\/h2>\n<p>Because we\u2019ve laid all the groundwork, getting the <code>add-to-cart<\/code> event working is as easy as editing the Lookup Table variable for the <code>x-pp-e_t<\/code> Transformation and modifying the trigger to also fire on the <code>add_to_cart<\/code> event.<\/p>\n<p>Here\u2019s what the modified Lookup Table variable looks like:<\/p>\n<div style=\"aspect-ratio: 1784 \/ 690;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/add-to-cart-lookup.jpg\" title=\"add-to-cart lookup\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"690\" width=\"1784\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/add-to-cart-lookup.jpg#ZgotmplZ\" alt=\"add-to-cart lookup\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<blockquote>\n<p>Please note that the <strong>Input<\/strong> has <code>add_to_cart<\/code> with underscores (this is the event name as GA4 uses it) and the <strong>Output<\/strong> has <code>add-to-cart<\/code> with hyphens (this is the Event Type for Piwik PRO).<\/p>\n<\/blockquote>\n<p>Here\u2019s what the updated trigger should be \u2013\u00a0as you can see, the regular expression is now <code>^(view_item|add_to_cart)$<\/code>.<\/p>\n<div style=\"aspect-ratio: 1852 \/ 938;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/add-to-cart-trigger.jpg\" title=\"Add to cart trigger\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"938\" width=\"1852\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/add-to-cart-trigger.jpg#ZgotmplZ\" alt=\"Add to cart trigger\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<blockquote>\n<p>Again, make sure the trigger looks for the GA4 <code>add_to_cart<\/code> event name and not the Piwik PRO <code>add-to-cart<\/code>.<\/p>\n<\/blockquote>\n<p>Save everything.<\/p>\n<h3 id=\"preview-and-test-2\">Preview and test<\/h3>\n<p>This should be easy \u2013 go to Preview mode, send a GA4 <code>add_to_cart<\/code> event to your Server container, and check the Console tab with the <code>add_to_cart<\/code> event selected:<\/p>\n<div style=\"aspect-ratio: 2380 \/ 726;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/add-to-cart-console-tab.jpg\" title=\"Add to cart in the console tab\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"726\" width=\"2380\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/add-to-cart-console-tab.jpg#ZgotmplZ\" alt=\"Add to cart in the console tab\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Wow, that looks good right away! The Tracker Debugger confirms our success:<\/p>\n<div style=\"aspect-ratio: 1250 \/ 690;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/tracker-debugger-add-to-cart.jpg\" title=\"Tracker Debugger and add-to-cart\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"690\" width=\"1250\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/tracker-debugger-add-to-cart.jpg#ZgotmplZ\" alt=\"Tracker Debugger and add-to-cart\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Excellent, it\u2019s all good!<\/p>\n<p>Here\u2019s what we did this time:<\/p>\n<ol>\n<li>Modify the Lookup Table to process the mapping of <code>add_to_cart<\/code> (GA4) to <code>add-to-cart<\/code> (Piwik PRO).<\/li>\n<li>Update the trigger to also fire with the <code>add_to_cart<\/code> event.<\/li>\n<\/ol>\n<p>The final event we\u2019ll cover in this article is <code>order<\/code>.<\/p>\n<h2 id=\"the-order-event\">The order event<\/h2>\n<p>The <code>order<\/code> event in Piwik PRO maps to the <code>purchase<\/code> event of GA4.<\/p>\n<p>Let\u2019s see if everything is as easy as in the previous section with <code>add-to-cart<\/code>.<\/p>\n<p>First, update the Lookup Table to account for the <code>purchase<\/code> &gt; <code>order<\/code> mapping.<\/p>\n<div style=\"aspect-ratio: 1768 \/ 778;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/purchase-order-lookup.jpg\" title=\"Purchase order lookup\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"778\" width=\"1768\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/purchase-order-lookup.jpg#ZgotmplZ\" alt=\"Purchase order lookup\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Then, update the trigger to listen for the <code>purchase<\/code> event, too, by changing the regular expression to <code>^(view_item|add_to_cart|purchase)$<\/code>.<\/p>\n<div style=\"aspect-ratio: 1766 \/ 878;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/purchase-trigger.jpg\" title=\"Purchase trigger\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"878\" width=\"1766\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/purchase-trigger.jpg#ZgotmplZ\" alt=\"Purchase trigger\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>Finally, save everything.<\/p>\n<h3 id=\"preview-and-test-3\">Preview and test<\/h3>\n<p>Refresh Preview mode, and do something to generate a <code>purchase<\/code> event to your SGTM endpoint. This is what the Console tab should include:<\/p>\n<div style=\"aspect-ratio: 2404 \/ 422;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/purchase-console.jpg\" title=\"purchase event in console\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"422\" width=\"2404\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/purchase-console.jpg#ZgotmplZ\" alt=\"purchase event in console\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>OK, ok! It looks good. The Event Type (<code>order<\/code>) is there, we\u2019ve got <code>revenue<\/code> (mapped from GA4\u2019s <code>value<\/code> automatically), <code>ec_id<\/code> is there with the Order ID, and <code>ec_products<\/code> is populated as well. What about the <strong>Tracker Debugger<\/strong>?<\/p>\n<div style=\"aspect-ratio: 1258 \/ 978;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/order-tracker-debugger.jpg\" title=\"Order in tracker debugger\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"978\" width=\"1258\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/order-tracker-debugger.jpg#ZgotmplZ\" alt=\"Order in tracker debugger\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>It\u2019s good!<\/p>\n<p>Thanks to the automatic mapping of <code>transaction_id<\/code> to <code>ec_id<\/code> and <code>value<\/code> to <code>revenue<\/code>, we didn\u2019t have to make any changes to the tag.<\/p>\n<h2 id=\"summary\">Summary<\/h2>\n<p>In this article, we started with a GA4 data stream collecting the following events:<\/p>\n<ul>\n<li><code>page_view<\/code><\/li>\n<li><code>view_item<\/code><\/li>\n<li><code>add_to_cart<\/code><\/li>\n<li><code>purchase<\/code><\/li>\n<\/ul>\n<p>To make things easier, we created a Transformation that generates some critical Piwik PRO-specific keys into the Event Data object:<\/p>\n<div style=\"aspect-ratio: 1846 \/ 1262;\" class=\"figure nocaption\">\n<p>    <a href=\"https:\/\/www.simoahava.com\/images\/2024\/07\/ecommerce-transformation.jpg\" title=\"Transformation for Piwik PRO\"><\/p>\n<p>    <img decoding=\"async\" class=\"fig-img\" height=\"1262\" width=\"1846\" loading=\"lazy\" src=\"https:\/\/www.simoahava.com\/images\/2024\/07\/ecommerce-transformation.jpg#ZgotmplZ\" alt=\"Transformation for Piwik PRO\"\/><\/p>\n<p>    <\/a><\/p>\n<\/div>\n<p>We didn\u2019t have to make any tag-specific changes. The template handles the most critical mappings automatically.<\/p>\n<p>We <em>did<\/em> create a separate tag for ecommerce. I\u2019m a huge fan of separating concerns, and this gives us room to maneuver in case we want to make ecommerce-specific adjustments to the data flow (which is very often the case!).<\/p>\n<p>This is by no means an exhaustive setup. Remember that Piwik PRO and GA4 have vastly different data models. You can check the Piwik PRO <a href=\"https:\/\/developers.piwik.pro\/en\/latest\/data_collection\/api\/http_api.html\">HTTP API documentation<\/a> to see the wide variety of signals that Piwik PRO can consume.<\/p>\n<p>Ideas for further development could include:<\/p>\n<ul>\n<li>Parse the GA4 session cookie for the session counter and map that to the <code>_idvc<\/code> (Visit Counter) parameter in the tag.<\/li>\n<li>Parse the GA4 Client ID cookie for the first visit timestamp and map that to the <code>_idts<\/code> (Time of First Visit) parameter in the tag.<\/li>\n<li>Add page timing metrics to the <strong>Page View<\/strong> tag.<\/li>\n<li>Create Goal Conversion events from the ecommerce hits.<\/li>\n<li>Map the Piwik PRO <code>ping<\/code> event to GA4\u2019s <code>user_engagement<\/code> hits.<\/li>\n<\/ul>\n<p>I hope this guide was useful! Let me know in the comments if you have questions about mapping GA4 requests to Piwik PRO events using server-side Google Tag Manager.<\/p>\n<\/p><\/div>\n\n","protected":false},"excerpt":{"rendered":"<p>There are two new custom templates available in server-side Google Tag Manager. These templates have been designed to facilitate Piwik PRO tracking in a server-side container. Piwik PRO Client -&gt; This Client template interacts with the Piwik PRO JavaScript tracker and lets you route Piwik PRO tracking through a server-side GTM container. GitHub repo. Piwik [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":27070,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[18473,1531,14495,18474,1190,18475,1791],"dealstore":[],"offerexpiration":[],"class_list":["post-27069","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-analytics","tag-ga4","tag-google","tag-manager","tag-piwik","tag-pro","tag-serverside","tag-tag"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>GA4 to Piwik PRO Using Server-side Google Tag Manager - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=27069\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GA4 to Piwik PRO Using Server-side Google Tag Manager - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"There are two new custom templates available in server-side Google Tag Manager. These templates have been designed to facilitate Piwik PRO tracking in a server-side container. Piwik PRO Client -&gt; This Client template interacts with the Piwik PRO JavaScript tracker and lets you route Piwik PRO tracking through a server-side GTM container. GitHub repo. Piwik [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=27069\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-14T21:48:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/01\/ga4-to-piwik-pro-using-server-side-google-tag-manager.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t<meta property=\"og:image:height\" content=\"540\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=27069#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=27069\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"GA4 to Piwik PRO Using Server-side Google Tag Manager\",\"datePublished\":\"2025-01-14T21:48:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=27069\"},\"wordCount\":2351,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=27069#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/01\/ga4-to-piwik-pro-using-server-side-google-tag-manager.jpg\",\"keywords\":[\"GA4\",\"Google\",\"Manager\",\"Piwik\",\"Pro\",\"Serverside\",\"TAG\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=27069#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=27069\",\"url\":\"https:\/\/fivemor.com\/?p=27069\",\"name\":\"GA4 to Piwik PRO Using Server-side Google Tag Manager - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=27069#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=27069#primaryimage\"},\"thumbnailUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/01\/ga4-to-piwik-pro-using-server-side-google-tag-manager.jpg\",\"datePublished\":\"2025-01-14T21:48:55+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=27069#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=27069\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=27069#primaryimage\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/01\/ga4-to-piwik-pro-using-server-side-google-tag-manager.jpg\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/01\/ga4-to-piwik-pro-using-server-side-google-tag-manager.jpg\",\"width\":960,\"height\":540},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=27069#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GA4 to Piwik PRO Using Server-side Google Tag Manager\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"GA4 to Piwik PRO Using Server-side Google Tag Manager - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=27069","og_locale":"en_US","og_type":"article","og_title":"GA4 to Piwik PRO Using Server-side Google Tag Manager - Som2ny Network","og_description":"There are two new custom templates available in server-side Google Tag Manager. These templates have been designed to facilitate Piwik PRO tracking in a server-side container. Piwik PRO Client -&gt; This Client template interacts with the Piwik PRO JavaScript tracker and lets you route Piwik PRO tracking through a server-side GTM container. GitHub repo. Piwik [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=27069","og_site_name":"Som2ny Network","article_published_time":"2025-01-14T21:48:55+00:00","og_image":[{"width":960,"height":540,"url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/01\/ga4-to-piwik-pro-using-server-side-google-tag-manager.jpg","type":"image\/jpeg"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=27069#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=27069"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"GA4 to Piwik PRO Using Server-side Google Tag Manager","datePublished":"2025-01-14T21:48:55+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=27069"},"wordCount":2351,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=27069#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/01\/ga4-to-piwik-pro-using-server-side-google-tag-manager.jpg","keywords":["GA4","Google","Manager","Piwik","Pro","Serverside","TAG"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=27069#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=27069","url":"https:\/\/fivemor.com\/?p=27069","name":"GA4 to Piwik PRO Using Server-side Google Tag Manager - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=27069#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=27069#primaryimage"},"thumbnailUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/01\/ga4-to-piwik-pro-using-server-side-google-tag-manager.jpg","datePublished":"2025-01-14T21:48:55+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=27069#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=27069"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=27069#primaryimage","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/01\/ga4-to-piwik-pro-using-server-side-google-tag-manager.jpg","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2025\/01\/ga4-to-piwik-pro-using-server-side-google-tag-manager.jpg","width":960,"height":540},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=27069#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"GA4 to Piwik PRO Using Server-side Google Tag Manager"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/27069","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=27069"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/27069\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/media\/27070"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=27069"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=27069"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=27069"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=27069"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=27069"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}