How do I set up Piwik PRO after using GA4 and Google Tag Manager?

When you’re switching from GA4 and Google Tag Manager to Piwik PRO, it may take a while before you set up your new account and get familiar with all available features. Most features in Piwik PRO are similar to Google’s tools, but some are different. In this article, we want to explain similarities and differences.

Contents

Quick start

If you want to quickly start with Piwik PRO, follow these steps:

  1. Install our container (with a tracking code) (Manual method, WordPress plugin, Wix site, other methods).
  2. Set up goals.
  3. Integrate with Google Search Console.
  4. Integrate with Google Ads.
  5. Create custom events and custom dimensions.
  6. Use the following settings to set things up:
  7. Review your setup using the debug mode and tracker debugger

This is the setup that we recommend but you can skip some of these steps. Now, if you want to dig into the differences between GA4, Google Tag Manager and Piwik PRO, read on.

Tracking code vs. container

In Piwik PRO, Analytics and Tag Manager are integrated – they are part of the whole stack. When you install our container’s code on your site or app, it contains a tracking code for Analytics.

GA4 Google Tag Manager Piwik PRO
Tracking code Container code Container code (with a tracking code)*

* It’s possible to install only a tracking code, but it’s a rare case. Most people want to use Analytics together with Tag Manager and Consent Manager because it gives them more control over their site or app.

For more on how to install Piwik PRO, see these articles:

Property vs. site or app

There’s a difference in the account structure between GA4 and Piwik PRO. You have one account in Piwik PRO under an account address like example.piwik.pro. In each account, you create sites or apps where you collect data. You can also create a meta site or app, that’ll let you combine data and use a meta setup in Tag Manager. A meta site or app is similar to roll-up reporting in Google Analytics.

Property structure and settings

GA4 Piwik PRO Read more
Property overview Admin > Property Site overview Administration > Site or App Read more
Data stream (Default URL) Admin > Data collection and modification > Data streams Site or app address Administration > Sites & apps > Data collection > Site or app address Read more
Search Console links Admin > Product links > Search Console links Site or app address Analytics > Settings > Integrations > Google Search Console Read more
Google Ads links Admin > Product links > Google Ads links Google Search Console Analytics > Settings > Integrations > Google Ads Read more
Property access management Admin > Property > Property access management Google Ads Administration > Sites & apps > Permissions Read more
Account access management Admin > Property > Account access management Permissions

Administration > Users > Invite a user

Administration > Users > Owner access

Read more
Tracking code

Admin > Data collection and modification > Data streams > Click on Data Stream > Google tag > View tag instructions > Install Manually

Admin > Data collection and modification > Data streams > Configure tag settings > Installation instructions > Install manually

Installation

Administration > Sites & apps > Installation

Note: In Piwik PRO, you install a container with a tracking code. This lets you use Tag Manager, Analytics, Consent Manager and Customer Data Platform.

*Customer Data Platform will be available soon on all accounts.

Read more
User ID Set the user ID in GTM by either creating a custom code tag to update the user ID value or configuring it in Google Tag > Configuration settings > Configuration Parameter. Set a user ID Tag Manager > Tags > Piwik PRO (tracking code) > Set a user ID Read more
List unwanted referrals

Admin > Data collection and modification > Data streams

––

Note: Referral exclusion is usually used to exclude payment gateways. In Piwik PRO by default, if a visitor returns to the site within the session window (30 minutes), the session will be continued under the original referrer.You can also choose to start a new session when the referrer or campaign changes:

Administration > Sites & apps > Data collection > Start a new session when the campaign changes

Administration > Global sites & apps > Data collection > Start a new session when the campaign changes

Administration > Sites & apps > Data collection > Start a new session when the referrer changes

Administration > Global sites & apps > Data collection > Start a new session when the referrer changes

Note: Global settings override per-site or app settings.

Account change history Admin > Account > Account Change History Audit log Administration > Account > Audit log Read more
Data filters/comparisons/segments

Admin > Data collection and modification > Data filters (filters out the data on the tracker level)

Admin > Data Display > Comparisons (filters out the data in the reports)

Explore > Create a new exploration > Build a new segment (applied to focus on specific details of data)

Segments/Data filtering methods

Analytics > Settings > Segments

Administration > Sites & apps > Data collection > Don’t collect data from these IP addresses

The setRequestProcessing method can be used to exclude some type of data from the tracker level.

Read more
DebugView Admin > Data display > DebugView Tracker debugger Analytics > Settings > Tracker debugger Read more
Trash Admin > Account > Trash ––
Analytics intelligence search history Admin > Property settings > Analytics Intelligence search history ––
Measurement protocol API secrets Admin > Data collection > Data streams > Data stream > Measurement Protocol API secrets API keys Menu > Profile (example@piwik.pro) > API keys Read more

Property settings vs. site or app settings

GA4 Piwik PRO Read more
Add a data stream Admin > Data collection and modification > Data streams > Add stream Add a site or app Administration > Add a site or app ––
Adjust session timeout

Admin > Data collection and modification > Data streams > Click on Data Stream > Configure tag settings > Adjust session timeout

The default duration of a session is 30 minutes, but it can be adjusted to last longer.

Adjust session cookie

Tag Manager > Piwik PRO > Privacy > Remove the session cookie at custom time

Note: Unlike in GA4, you cannot change the default session duration in Piwik PRO. The 30-minute inactivity timeout is hardcoded and cannot be adjusted.

––
Reporting time zone Admin > Property > Property details > Reporting time zone Time zone

Administration > Site or app > Basic info > Time zone

Administration > Meta site or app > Basic info > Time zone

Read more
Exclude URL query parameters

Admin > Data streams > Data stream > Redact data > URL query parameters

Alternatively, you could create a custom JS variable that retrieves the query value and is sent with a custom tag that as a field within the fields to set section.

Remove parameters from page URLs

Administration > Sites & apps > Data collection tab > Remove parameters from page URLs

Administration > Settings > Global site & app settings > Data collection > Remove parameters from page URLs

Note: Global settings override individual settings.

Read more
Currency displayed as Admin > Property > Property details > Currency displayed as Currency

Administration > Site > Basic info > Currency

Administration > Meta site or app > Basic info > Currency

Read more
Bot filtering Bot filtering is applied automatically. The bot traffic can be also filtered out in the reports section. Add crawlers

Administration > Sites & apps > Data collection > Add crawlers

Administration > Settings > Global site & app settings > Add crawlers

Note: Global settings override individual settings.

Read more
Site search settings Admin > Data streams > Data stream > Keywords from your internal search engine Keywords from your internal search engine

Administration > Sites & apps > Data collection > Keywords from your internal search engine

Administration > Settings > Global site & app settings > Keywords from your internal search engine

Note: Global settings override individual settings.

Read more
JavaScript errors JS errors are not tracked by default and should be set up through GTM by creating a custom event that has all the necessary error message values and has the Javascript error trigger. Detect JavaScript errors

Tag Manager > Piwik PRO tag > UX issues > Detect JavaScript errors

Note: JS errors are tracked by default in Piwik PRO and can be disabled in the Piwik PRO tag.

––
Key events Admin > Data display > Key events Goals Analytics > Goals > Add a goal Read more
Content groups Adding a content group to a report or setting it up in GTM: Google Support Custom channel grouping Analytics > Settings > Dimension value grouping Read more
Channel groups Admin > Data display > Channel groups Custom channel grouping Analytics > Settings > Custom channel grouping Read more
Custom dimensions Admin > Data display > Definitions > Custom Dimensions Custom dimensions Analytics > Settings > Custom dimensions Read more
Calculated metrics Admin > Data display > Definitions > Calculated metrics Calculated metrics Analytics > Settings > Calculated metrics Read more
Custom metrics Admin > Data display > Definitions > Custom metrics ––
Attribution settings Admin > Data display > Attribution settings Custom attribution models

Analytics > Settings > Custom attribution models

Note: Unlike in GA4, we cannot modify the attribution settings. While custom attribution models can be used to compare data in predefined reports, they do not alter how data is attributed across different channels.

Read more
Scheduled reports Reports > Report > Share this report > Schedule Email Scheduled reports Analytics > Settings > Scheduled reports Read more
Insights Reports > Insights Alerts Analytics > Settings > Alerts Read more
Saved reports Homepage > Library Custom report Analytics > Custom reports Read more
Redact data

Admin > Data streams > Data stream > Redact data

Note: This can only be achieved through the setRequestProcessing method

––

Note: This can only be achieved through the setRequestProcessing method

Annotations No such feature for now in GA4 Notes Analytics > Report > Note Read more
Cross-domain tracking Admin > Data streams > Data stream > Configure tag settings > Configure your domains Cross-domain tracking/cross-subdomain tracking

Tag Manager > Piwik PRO tag > Recognize a visitor across domains

Tag Manager > Piwik PRO tag > Recognize a visitor across subdomains

––
Reporting identity

Admin > Data display > Reporting identity

Note: Select the methods Analytics uses to link events to users.

Note: When the user ID is set, it takes priority over the visitor ID. ––
Audiences

Admin > Data display > Audiences

Note: Audiences segment your data according to different types of users.

Customer Data Platform* /Segments

*Customer Data Platform will be available soon on all accounts.

Something similar to audiences can be achieved through Customer Data Platform or segments.

Customer Data Platform not only allows us to segment visitors but also to activate data on them.

––

Privacy settings

Piwik PRO offers a built-in consent management system that lets you collect data and stay compliant with GDPR, CCPA, TDDDG and more. Privacy laws are complex, but we prepared a set of settings that let you quickly configure the product to comply with them. See the following articles to decide which option to use:

Scopes

There is a difference in the scopes available to users in each tool.

GA4 Piwik PRO

GA4 relies heavily on data sent with custom events and offers different scopes to users: user scope, session scope, event scope and item scope. The data can be analyzed on multiple layers in a hierarchical structure, with the user scope being the main scope. Every event and session falls under the user scope.

The hierarchy is as follows: User scope > Session scope > Event scope > Item scope.

Piwik PRO is more session-oriented and relies on data from a user’s session, which consists of custom events and lasts up to 30 minutes after the visitor’s last registered event. Unlike GA4, Piwik PRO uses the session scope as its main scope instead of the user scope. Dimensions that describe the visitor, such as country of origin, IP address or user ID, are assigned to a session.

Since there are no user-scoped dimensions in Piwik PRO, visitor details are collected based on session data. To replicate user-scoped dimensions from GA4, you can create a user ID or custom session dimensions and assign relevant visitor details to them.

Reports

Reports in Piwik PRO are quite similar to the ones in GA4. Take a look at this list to find the ones you like the most.

GA4 Piwik PRO Read more
Realtime
Reports > Realtime Analytics > Real-time dashboards Read more
Acquisition
Overview, User Acquisition, Traffic Acquisition, User Acquisition cohorts Channel, Search Engine, Website & Social, Campaign, Google Search Console, Google Ads
Engagement
Overview, Events, Conversions, Pages and Screens Page, Internal Search, Outlink, Download, Custom Event, Content Performance
Monetization
Overview, E-commerce Purchases, In-app Purchases, Publisher Ads Analytics > Ecommerce Read more
Retention
User Retention Analytics > Engagement ––
Demographics
Overview, Demographic Details Device & Software, Location ––
Tech
Overview, Tech Details Device & Software ––
Explore (Custom explorations)
Free-form exploration, Funnel exploration, Path exploration, Segment overlap, User explorer, Cohort analysis Custom Reports (Flat table, Explorer, Bar chart, Line chart, Funnel, User flow, Attribution)/Dashboards ––
Advertising
Conversion paths, Model comparison Google Ads, Google Search console, Attribution ––
Advertising
Detailed advertising reports with AdSense, GAds and the like. –– ––
Video analytics
–– Analytics > Video analytics > Video overview Read more
Video analytics
–– Analytics > Video analytics > Video overview Read more
–– Analytics > Video analytics > Video flow Read more
–– Analytics > Video analytics > Video timing Read more
Website performance
–– Analytics > Page timing ––
Consent tracking
–– Analytics > Reports > Consent ––

Google Tag Manager vs. Piwik PRO Tag Manager

In Piwik PRO, Tag Manager is an integrated part of the whole stack. After you install our container on your site or app, you can start adding tags, triggers and variables. Tag Manager is also seamlessly integrated with Consent Manager, and you can set consent types for each tag.

Our Tag Manager is quite similar to Google Tag Manager, but there are some differences. Here’s how they are different.

General differences

Google Tag Manager Piwik PRO
In GA4, you need to add a unique measurement ID to each event you create in Tag Manager. This ID corresponds with your data stream’s ID in GA4, making the process more complex. In contrast, Piwik PRO’s tracking container includes all modules in a single script, eliminating the need to add specific IDs to events. This simplifies the process of creating custom events.
In GA4, you can add event parameters to store additional information in custom events. In Piwik PRO, you achieve this by creating a custom event dimension and adding it to your custom event in Tag Manager.
In GA4, ‘User Properties’ add details about a visitor. In Piwik PRO, you can use custom session dimensions to include visitor details in a session, adding relevant information like login status or language to custom events.

Tags

Google Tag Manager (GTM) Piwik PRO Read more
Custom
Custom HTML

Custom code (async)

Note: See also our developer documentation to find JS methods that you can apply.

Custom Image Custom content Read more
–– Popup Read more
Piwik PRO
Google Analytics: Universal Analytics

Piwik PRO (tracking code)

Note: This tag is added automatically after you install our container on your site or app. It has some settings that allow you control data collection.

If you want to add Google’s tracking code, use a Google Analytics Tracking tag.

Read more
–– Custom dimension Read more
––

Custom event

Note: Google’s custom event has: Category, Action, Label and Value. Piwik PRO has Category, Action, Name and Value.

Read more
–– Collecting data from forms Read more
–– Goal conversion Read more
–– Virtual page view Read more
–– YouTube video tracking Read more
–– HTML5 video tracking Read more
–– Heatmap & clickmap Read more
Third-party
Google Analytics: Universal Analytics Google Analytics Tracking Read more
Google Analytics: GA4 Configuration ––
Google Analytics: GA4 Event ––
Google Ads Conversion tracking Google Ads Conversion tracking Read more
Google Ads Remarketing Google Ads Remarketing Read more
Floodlight Counter Floodlight Counter Read more
Floodlight Sales Floodlight Sales Read more
Conversion linker

––

Note: You can export goal conversions from Piwik PRO to Google Ads manually.

Google Optimize ––
Google Surveys Website Satisfaction ––
Featured Community CMP Templates

––

Note: Piwik PRO has a built-in consent management tool. It works right after you install our container on your site or app.

AB TASTY Generic Tag AB Tasty Read more
Adometry ––
AdRoll Smart Pixel AdRoll Pixel Read more
Audience Center 360 ––
AWIN Conversion ––
AWIN Journey ––
Bizrate Insights Buyer Survey Solution ––
Bizrate Insights Site Abandonment Survey Solution ––
comScore Unified Digital Measurement ––
Crazy Egg Crazy Egg Tracking Script Read more
–– Meta Pixel (formerly Facebook Pixel) Read more
–– Bing Universal Event Tracking Read more
Hotjar Tracking Code Hotjar Tracking Code Read more
–– HubSpot Tracking Code Read more
LinkedIn Insights LinkedIn Insights Read more
–– Marketo Munchkin JavaScript Read more
–– Mautic Tracking Code Read more
Pinterest Tag

––

Note: You can take the Pinterest tag and install it as a custom code (async).

–– Salesforce and Pardot Tracking Code Read more
SearchForce JavaScript Tracking for Conversion Page ––
SearchForce JavaScript Tracking for Landing Page ––
SearchForce Redirection Tracking ––

Triggers

Google Tag Manager (GTM) Piwik PRO Read more
Page view
Consent Initialization

––

Note: All tags in Piwik PRO are fired based on visitor’s consent. Consents are collected using our built-in consent management tool.

Initialization ––
Page View Page view > DOM lifecycle event > Page view Read more
DOM Ready Page view > DOM lifecycle event > DOM Ready Read more
Window Loaded Page view > DOM lifecycle event > Page load Read more
Click
All Elements

Click

Note: You can use a CSS selector or XPath as a part of trigger settings.

Read more
Just Clicks ––
User engagement
Element Visibility

Element presence

Note: The ID Selection Method is not available in Piwik PRO.

Read more
Form Submission

Form submission

Note: This trigger fires a tag when the form is submitted successfully. To set this trigger on submission click only, use a click trigger.

Read more
Scroll Depth

Page scroll

Note: Piwik PRO tracks page scrolls automatically. You just need to set up reporting for it.

Read more
YouTube Video

––

Note: In Piwik PRO, you can track HTML5 videos and YouTube videos automatically.

Other
–– Data layer event Read more
History Change

History change (SPA)

Note: Piwik PRO tracks SPAs automatically.

Read more
JavaScript Error

––

Note: In Piwik PRO, we collect JavaScript errors by default. They can be turned on or off in Tag Manager > Tags > Piwik PRO (tracking code).

–– Page leave Read more
Timer Timer Read more
Trigger Group

––

Note: We plan to release such feature soon. For now, you can use trigger conditions to achieve the same goal.

Trigger exceptions

––

Note: You can use trigger conditions to achieve the same goal.

Additional information
Add Exception ––
Built-in variables

Built-in variables

Note: You can use them as triggers.

Read more
Variables as triggers

Triggers > Add a trigger > Trigger type > Use a variable as a trigger condition

Note: After you create a variable, you can use it as a trigger condition.

Read more

Built-in variables

Google Tag Manager (GTM) Piwik PRO Read more
Pages
Page URL Page URL Read more
Page Hostname Page hostname Read more
Referrer Referrer Read more
–– Page path Read more
Utilities
Event Event Read more
Environment name ––
Container ID ––
Container Version ––
Random Number

––

Note: You can use a user-defined variable: Random number.

HTML ID ––
Errors
Error Message ––
Error URL ––
Error Line ––
Debug Mode ––
Clicks
Click Element Click element Read more
Click Class Click classes Read more
Click ID Click ID Read more
Click Target ––
Click URL Click URL Read more
Click Text ––
Forms
Form Element ––
Form Classes Form classes Read more
Form ID Form ID Read more
Form Target ––
Form URL Form URL Read more
–– Form name Read more
Form Text ––
History
New History Fragment History fragment Read more
Old History Fragment Old history fragment Read more
New History State History state Read more
Old History State Old history state Read more
History Source History source Read more
Videos
Video provider

––

Note: In Piwik PRO, you can track HTML5 videos and YouTube videos automatically.

Video Status
Video URL
Video Title
Video Duration
Video Current Time
Video Percent
Video Visible
Scrolling
Scroll Depth Threshold ––
Scroll Depth Units ––
Scroll Direction ––
Visibility
Percent Visible ––
On-Screen Duration ––

User-defined variables

Google Tag Manager (GTM) Piwik PRO Read more
Variable Configuration
Format value ––
Navigation
HTTP Referrer ––
URL URL Read more
1st Party Cookie Cookie Read more
Custom JavaScript

Custom JS

Note: Referring to a variable using another variable is not available yet. We plan to release it in the future.

Read more
Data Layer Variable Data layer Read more
JavaScript ––
Auto-Event Variable ––
DOM Element DOM element Read more
Element Visibility

––

Note: You can use an element presence trigger.

Constant Constant Read more
Custom Event ––
Environment Name ––
Google Analytics Settings ––
Lookup Table

Lookup table

Note: Available from 16.33.0

Read more
Random number

Random number

Note: This variable sets the random value from 0 to 1, including 0 but not 1.

Read more
RegEx Table ––
Undefined Value ––
User-Provided Data ––
Container data
Container ID ––
Container Version Number ––
Debug Mode ––
Additional information
Refer to a variable using another variable

You can use an existing custom or built-in variable inside another variable. When setting up a variable value, use {{ My existing variable }} to refer to the existing variable.

Note: Avaliable from 16.30.0.

Refer to multi-level data layer objects ––

Settings

Google Tag Manager (GTM) Piwik PRO Read more
Tag firing priority Settings > Tag priority > Prioritized tags Read more
Enable custom tag firing schedule Tags > Add a tag > Flight dates Read more
Only fire this tag in published containers

––

Note: You can debug active tags before publishing.

Tag firing options

Triggers > Add a trigger > Multiplicity

Note: You can use this option while setting up a trigger.

Read more
Tag sequencing Settings > Tag priority > Prioritized tags Read more
Additional Tag Metadata ––
Consent Settings (Beta) Tags > Add a tag > Advanced tag settings > Consent type Read more

Preview mode

Google Tag Manager (GTM) Piwik PRO Read more
Preview mode Debug mode Read more
–– Tracker debugger Read more
Other useful tools
Omnibug

Omnibug

Note: You can use it to see requests in the browser. Works best on Firefox.

Read more
Tampermonkey

Tampermonkey

Note: You can use it to add Piwik PRO container or just a tracking code to test things out.

Read more

Admin

Google Tag Manager (GTM) Piwik PRO Read more
Account ID

Site or app ID

Administration > Sites & apps > The ID is under a site or app name

Read more
Share data anonymously with Google and others

––

Note: Piwik PRO doesn’t share your data with anyone.

Require 2-step login verification for certain operations

––

Note: We plan to release it soon.

Account Activity

Tag Manager > Changelog

Note: If you want to see user activity in the whole Piwik PRO see Administration > Settings > Audit log.

Read more
User Management

Administration > Settings > Users

Administration > Settings > Groups

Note: In Piwik PRO, you manage permissions for the entire platform: Administration, Analytics, Tag Manager, Consent Manager.

Read more
Container settings ––
Install Google Tag Manager

Administration > Sites & Apps > Installation

Note: In Piwik PRO, you install a container (with a tracking code). This lets you use the whole stack: Analytics, Tag Manager, Consent Manager.

Read more
Import Container

Tag Manager > Settings > Import > Import settings from another site or app

Note: You can also import a container from a file.

Read more
Export Container

Tag Manager > Changelog > Snapshot > Export settings to file

Note: You can also export or import container settings from a different site or app.

Read more
Approval Queue ––
Environment

––

Note: You can create different environments by using Administration > Sites & apps.

Container Notifications ––

Custom code events (API methods)

Both tools allow users to send custom events manually using API methods. These methods enable users to send custom events from the source code level or from the Tag Manager if they use a custom code tag. The structure of the JS methods differs between the two tools. Piwik PRO uses the _paq.push reference to specify the information to convey in custom events, while GA4 uses the gtag reference.

Here are some examples of how custom event methods in GA4 JS snippets can be translated to Piwik PRO terms.

Method GA4 Piwik PRO
Track page views gtag(‘event’, ‘page_view’, {
  page_title: ‘<Page Title>’,
  page_location: ‘<Page Location>’
});

_paq.push([“trackPageView”]);

Read more

Track events gtag(‘event’, ‘<event_name>’, {<event_parameters>});

_paq.push([“trackEvent”, CATEGORY*, ACTION**, NAME***, VALUE****]);

*Event category (string)

**Event action (string)

***Event name (string)

****Event value (integer)

Track goals GA4 does not provide a way for users to manually set a tracking goal through JS methods.

_paq.push([“trackGoal”, GOAL_ID*, CONVERSION VALUE**]);

*Goal ID (string/integer)

**Conversion value (integer)

Set custom dimensions GA4 does not provide a way to set custom dimensions manually using JS methods. In GA3, you could use the ga('set', <dimension>, <value>); method, but in GA4, you can add these parameters directly to your trackEvent method.

_paq.push([“setCustomDimensionValue”, DIMENSION_ID*, VALUE**]);

*Dimension ID (integer)

**Dimension value (string/integer)

Set user IDs gtag(‘config’, ‘TAG_ID’, {
  ‘user_id’: ‘USER_ID’
});

_paq.push([“setUserId”, USER_ID*]);

*User ID (string)

Ecommerce setup

There are some differences between GA4 and Piwik PRO in how they handle ecommerce setup.

GA4 Piwik PRO
GA4 and GTM do not offer built-in template tags for ecommerce setup. To ensure your ecommerce setup functions correctly, you need to create GA4 tags and enter the appropriate parameters manually, or use API methods with the gtag reference. Piwik PRO allows you to set up ecommerce tracking using built-in template tags from Tag Manager or by using API methods to send ecommerce events manually. The values sent with these events can be based on parameters available in the dataLayer. You don’t need to adjust the dataLayer structure, and when migrating from GA4 to Piwik PRO, you can use your existing GA4 ecommerce dataLayer to pass values to your ecommerce events in Piwik PRO. Read more
In both environments, you can send ecommerce events manually. However, you won’t be able to migrate the same ecommerce snippets from GTM to Piwik PRO because they use different method references: gtag in GA4 and GTM, and _paq.push in Piwik PRO.
Both tools allow users to create custom product dimensions and attach them to ecommerce events, making the data more tailored and including details not available by default in either tool.

Here are some key differences in the structure of ecommerce events between the two tools.

Method GA4 Piwik PRO
Select an item from a list gtag(“event”, “view_item_list”, {
  item_list_id: “related_products”,
  item_list_name: “Related products”,
  items: [{
    item_id: “SKU_12345”,
    item_name: “Stan and Friends Tee”,
    affiliation: “Google Merchandise Store”,
    coupon: “SUMMER_FUN”,
    discount: 2.22,
    index: 0,
    item_brand: “Google”,
    item_category: “Apparel”,
    item_category2: “Adult”,
    item_category3: “Shirts”,
    item_category4: “Crew”,
    item_category5: “Short sleeve”,
    item_list_id: “related_products”,
    item_list_name: “Related Products”,
    item_variant: “green”,
    location_id: “ChIJIQBpAG2ahYAR_6128GcTUEo”,
    price: 10.01,
    quantity: 3
  }]
});
This has to be handled through custom events or through the _paq.push(["trackEvent"]); method.
View item details gtag(“event”, “view_item”, {
  currency: “USD”,
  value: 30.03,
  items: [{
    item_id: “SKU_12345”,
    item_name: “Stan and Friends Tee”,
    affiliation: “Google Merchandise Store”,
    coupon: “SUMMER_FUN”,
    discount: 2.22,
    index: 0,
    item_brand: “Google”,
    item_category: “Apparel”,
    item_category2: “Adult”,
    item_category3: “Shirts”,
    item_category4: “Crew”,
    item_category5: “Short sleeve”,
    item_list_id: “related_products”,
    item_list_name: “Related Products”,
    item_variant: “green”,
    location_id: “ChIJIQBpAG2ahYAR_6128GcTUEo”,
    price: 10.01,
    quantity: 3
  }]
});
Built-in ecom template tag (Ecommerce product detail view) or manual method:
_paq.push([
  “ecommerceProductDetailView”,
  [{
    sku: “craft-311”,
    name: “Unicorn Iron on Patch”,
    category: [“Crafts & Sewing”, “Toys”],
    price: “49.90”,
    quantity: 3,
    brand: “DMZ”,
    variant: “blue”,
    customDimensions: {
      1: ‘coupon-2020’,
      2: ‘20%’
    }
  }]
]);
Add a product to a shopping cart GA4 tag in GTM or manual method: Add or remove an item from a shopping cart Built-in ecom template tag (Ecommerce add to cart) or manual method:
_paq.push([
  “ecommerceAddToCart”,
  [{
    sku: “craft-311”,
    name: “Unicorn Iron on Patch”,
    category: “Crafts & Sewing”,
    price: “49.90”,
    quantity: 3,
    brand: “DMZ”,
    variant: “blue”,
    customDimensions: {
      1: ‘coupon-2020’,
      2: ‘20%’
    }
  }]
]);
Remove a product from a shopping cart GA4 tag in GTM or manual method: Add or remove an item from a shopping cart Built-in ecom template tag (Ecommerce remove from cart) or manual method:
_paq.push([
  “ecommerceAddToCart”,
  [{
    sku: “craft-311”,
    name: “Unicorn Iron on Patch”,
    category: “Crafts & Sewing”,
    price: “49.90”,
    quantity: 3,
    brand: “DMZ”,
    variant: “blue”,
    customDimensions: {
      1: ‘coupon-2020’,
      2: ‘20%’
    }
  }]
]);
Initiate the checkout process GA4 tag in GTM or manual method: Initiate the checkout process This has to be handled through custom events or through the _paq.push(["trackEvent"]); method.
Make purchases gtag(“event”, “purchase”, {
  transaction_id: “T_12345”,
  value: 72.05,
  tax: 3.60,
  shipping: 5.99,
  currency: “USD”,
  coupon: “SUMMER_SALE”,
  items: [{
    item_id: “SKU_12345”,
    item_name: “Stan and Friends Tee”,
    affiliation: “Google Merchandise Store”,
    coupon: “SUMMER_FUN”,
    discount: 2.22,
    index: 0,
    item_brand: “Google”,
    item_category: “Apparel”,
    item_category2: “Adult”,
    item_category3: “Shirts”,
    item_category4: “Crew”,
    item_category5: “Short sleeve”,
    item_list_id: “related_products”,
    item_list_name: “Related Products”,
    item_variant: “green”,
    location_id: “ChIJIQBpAG2ahYAR_6128GcTUEo”,
    price: 10.01,
    quantity: 3
  },
  {
    item_id: “SKU_12346”,
    item_name: “Google Grey Women’s Tee”,
    affiliation: “Google Merchandise Store”,
    coupon: “SUMMER_FUN”,
    discount: 3.33,
    index: 1,
    item_brand: “Google”,
    item_category: “Apparel”,
    item_category2: “Adult”,
    item_category3: “Shirts”,
    item_category4: “Crew”,
    item_category5: “Short sleeve”,
    item_list_id: “related_products”,
    item_list_name: “Related Products”,
    item_variant: “gray”,
    location_id: “ChIJIQBpAG2ahYAR_6128GcTUEo”,
    price: 21.01,
    promotion_id: “P_12345”,
    promotion_name: “Summer Sale”,
    quantity: 2
  }
  ]
});
Built-in ecom template tag (Ecommerce order) or manual method:
_paq.push([
  “ecommerceOrder”,
  [{
    sku: “craft-311”,
    name: “Unicorn Iron on Patch”,
    category: “Crafts & Sewing”,
    price: “150.00”,
    quantity: 3,
    brand: “DMZ”,
    variant: “blue”,
    customDimensions: {
      1: ‘coupon-2020’,
      2: ‘20%’
    }
  },
    {
    sku: “craft-312”,
    name: “Unicorn Iron on Grass”,
    category: “Crafts & Sewing”,
    price: “30.00”,
    quantity: 1,
    brand: “DMZ”,
    variant: “red”,
    customDimensions: {
      1: ‘coupon-2020’,
      2: ‘20%’
    }
  }
  ],
  {
    orderId: “order-3415”,
    grandTotal: “180.00”,
    subTotal: “120.00”,
    tax: “39.60”,
    shipping: “60.00”,
    discount: “18.00”
  }
]);
Make refund gtag(“event”, “refund”, {
  currency: “USD”,
  transaction_id: “T_12345”,
  value: 30.03,
  coupon: “SUMMER_FUN”,
  shipping: 3.33,
  tax: 1.11,
  items: [{
    item_id: “SKU_12345”,
    item_name: “Stan and Friends Tee”,
    aff iliation: “Google Merchandise Store”,
    coupon: “SUMMER_FUN”,
    discount: 2.22,
    index: 0,
    item_brand: “Google”,
    item_category: “Apparel”,
    item_category2: “Adult”,
    item_category3: “Shirts”,
    item_category4: “Crew”,
    item_category5: “Short sleeve”,
    item_list_id: “related_products”,
    item_list_name: “Related Products”,
    item_variant: “green”,
    location_id: “ChIJIQBpAG2ahYAR_6128GcTUEo”,
    price: 10.01,
    quantity: 3
  }]
});
This has to be handled through custom events or through the _paq.push(["trackEvent"]); method.
Apply promotions gtag(“event”, “view_promotion”, {
  creative_name: “Summer Banner”,
  creative_slot: “featured_app_1”,
  promotion_id: “P_12345”,
  promotion_name: “Summer Sale”,
  items: [{
    item_id: “SKU_12345”,
    item_name: “Stan and Friends Tee”,
    affiliation: “Google Merchandise Store”,
    coupon: “SUMMER_FUN”,
    discount: 2.22,
    index: 0,
    item_brand: “Google”,
    item_category: “Apparel”,
    item_category2: “Adult”,
    item_category3: “Shirts”,
    item_category4: “Crew”,
    item_category5: “Short sleeve”,
    item_list_id: “related_products”,
    item_list_name: “Related Products”,
    item_variant: “green”,
    location_id: “ChIJIQBpAG2ahYAR_6128GcTUEo”,
    price: 10.01,
    quantity: 3
  }]
});
This has to be handled through custom events or through the _paq.push(["trackEvent"]); method, also, the promotions can be applied as a value to a custom product dimension and then sent with a ecommerceOrder event.

For more information on setting up and structuring ecommerce in Piwik PRO, see this article.

For more details on ecommerce API methods, see this article.

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