Google Tag Manager (server-side) integration

Analytics

Available from 16.0.0

Needed permissions: owner

Integration for: Google Tag Manager (server-side)

When you use server-side Google Tag Manager to collect data for Google Analytics, you can use our integration to send that data to Piwik PRO. The integration uses a dedicated tag in Google Tag Manager. The tag sends tracked events from Google Tag Manager to Piwik PRO in real time.

To integrate, you’ll have to add a site or app in Piwik PRO, and then set up our dedicated tag in Google Tag Manager.

Google Tag Manager (server-side) integration

Before you start

Here are some things to know before you start:

  • Needed permissions in Piwik PRO: owner.
  • Needed permissions in Google Tag Manager: administrator.
  • This integration works best with Universal Analytics (GA3) because it has a similar data model to Piwik PRO. Some concepts of server-side tagging differ from regular web-based ones. Read more.

Add a site or app in Piwik PRO

To add a site or app in Piwik PRO, follow these steps:

  1. Go to Menu > Administration.
  2. Navigate to Sites & apps.
  3. Click Add a site or app.
  4. Type the site or app name and address and click Save.
    Add a site or app in Piwik PRO

    Note: If you want to track a few domains, add their addresses.

  5. Set the time zone and currency.
    Set the time zone and currency

    Note: We’ll show data in reports in this time zone. We’ll use this currency for goal revenue.

Integrate with Google Tag Manager (server-side)

To integrate with server-side Google Tag Manager, follow these steps:

  1. Download our dedicated tag.

    Note: Our dedicated tag will soon be available in Google’s Tag Manager Template Gallery.

  2. Log in to Google Tag Manager.
  3. Open your server-side container.
  4. Go to Templates.
  5. In Tag Templates, click New.
    Create a new Tag Template
  6. Click the  three-dot icon in the upper right corner and select Import.
    Import the template
  7. Upload the template you’ve downloaded in step 1.
  8. Click Save.
  9. Navigate to Tags.
  10. Click New.
  11. Click Choose a tag type to begin setup…
    Choose a tag type
  12. Choose Piwik PRO server-side from the list.
    Choose Piwik PRO server-side from the list
  13. In Account address, enter your Piwik PRO account address (Example: example.piwik.pro).
    ENter your Piwik PRO account address
  14. In Site or app ID, add the ID of the site or app in Piwik PRO where you want to send data. (Where to find it?).
    Add the ID of the site or app in Piwik PRO
  15. In Data collection, you can set the following parameters:
    • Use default tracking paths: By default, all events will be sent to the default “ppms.php” endpoint. Turn this option off to set your own path.
    • Anonymize data: If turned on, you won’t collect personal data like the visitor’s IP address and location data (only country data will be available).
    • Send custom dimensions: If turned on, you’ll send a custom dimension with each event sent to Piwik PRO.
    Set the parameters in Data collection
  16. If you turned on Send custom dimensions, you can now map them.
    Map the custom dimension
  17. Click Add a custom dimension.
  18. In Source Custom Dimension ID, add the ID from Google Analytics.
  19. In Piwik PRO Analytics Custom Dimension ID, add the ID from Piwik PRO.
    Add the ID from Piwik PRO
  20. In Triggering, click Choose a trigger to make this tag fire.
    Choose a trigger to make this tag fire
  21. Choose the following trigger: All Pageviews or All Events. This is when the tracked event for Google Analytics will be sent to Piwik PRO.
    Choose one of the triggers
  22. Click Save.
  23. Click Submit.
  24. Click Publish
  25. Done! Data is now sent to Piwik PRO in real time. Data will appear in reports in about an hour. Data in the tracker debugger will appear instantly.

Was this article helpful?

Technical support

If you still have any questions, visit our community.
There’s always someone happy to help!

Back to help center