Server-side tagging best practice

Hi Piwik community! I am looking for the best practice way of setting up the following:

  • Use server-side tagging to avoid privacy blockers and get more accurate data (for firing FB Conversions, GA4 tags and Piwik Pro analytics)
  • Using Piwik Analytics suite
  • Using a consent manager

As far as I understand I need to use Google Tag Manager for server-side containers because Piwik Pro itself does not support any server-side containers? Piwik only support ‘receiving data server side for analytics suite’. Is that correct?

If so, then I think the value of using the Tag Container of Piwik and the Consent Manager becomes limited. I would rather use only GTM in such a case since we need to have it anyway for the server-side implementation. And in such a case we cannot use Consent Manager of Piwik since consent needs to be known before we fire other GTM tags which is not the case if Piwik is fired inside GTM.

Can someone share a diagram or best practice approach to combine server-side containers with Piwik?

Yes. We don’t support server side tagging. We have a server side tracking solution, but it’s available only in the Enterprise plan.

From our perspective, you have to make sure that a request with valid consent reaches the server side tag. Once that’s done, you simply forward the data to Piwik PRO using our server-side tag template.

Hey Kuba. Thanks for the answer. So for server side tagging we should use GTM. What is the best approach to use GTM server-side container together with Piwik? Should we use the client side Tag Container of Piwik and also the Consent Manager or is it better to avoid using that and use only client side GTM containers next to the serverside GTM containers? It is a bit unclear for me how to run that next to eachother.

Why I ask this is:

Hi. For now I’d go with client side GTM → server side GTM. With this scenario, you can use our tag template for server side GTM. Currently, we don’t provide a client template that would work with server side GTM.

Thanks for the clarification. If I use client side GTM, it is probably not so optimal to use your Consent Manager, is that correct? Because it would require firing the client side tag of Piwik which we wanna replace with the server-side tag? So the optimal situation would be:

  1. Use client-side GTM for firing all tags (Hotjar, GA4, etc…)
  2. Use consent manager like Cookiebot or so because it works well with GTM before firing the tags
  3. Use server-side GTM to send data to Piwik Pro, GA4, FB Conversion API, etc…
  4. Use Piwik Pro interface for analytics and reports

Is that correct? Thanks for your patience :slight_smile:

Yes, that would be my recommendation as well. I’ll make sure to notify you once we have the client template. :slight_smile:

Hey @kuba, some quick follow up questions as its related to this

  1. Is the client side template something that is expected in q3 this year or you cant commit anything at this stage?
  2. As GA 3 is being deprecated ideally my client would like to base it of GA4, is the data model to different in your view to be compatible?
    Thanks in advance.

I think Piwik Pro has to base itself on GA4 or at least support both. Most third-party plugins in the market are moving away from UA and in the future only support for GA4 will be there. Ecommerce or CMS systems (and their plugin community) will base their datalayer and events on support for GA4. That means that if Piwik wants to make implementation easy they should also adopt GA4 support.

Facebook Conversion API is doing the same by the way. So I hope Piwik will change this soon…

  1. I can’t commit anything at this stage. But I know somebody who should have some more insights (@Piotrek) :slight_smile: He came up with this idea initially.
  2. For now the template works better with UA but we’ll be definitely updating it to better support GA4. I don’t see any hard blockers to provide a good template for GA4 as well.
1 Like