Data layer event trigger

Tag Manager

Video tutorial: watch on YouTube

A data layer event trigger fires a tag on a selected data layer event on all pages. By default, it fires the tag for the selected event on any page. However, you can change its settings so that the tag fires for a specific page or under specific conditions.

Data layer event trigger in Piwik PRO

Here’s a list of conditions available in this trigger.

Data layer event conditions

Condition type Description Example
Event Fires the tag when the selected event occurs in a data layer. For example, you can fire a tag when a visitor adds a product to their cart. This condition is always required. Event equals addToCart

Event conditions

Condition type Description Example
Page URL Fires the tag when a visitor is on a page with the selected page URL and the selected event occurs in a data layer. For example, a visitor is on the page https://clearbank.com/product-tour and the data layer event occurs. Page Url equals https://clearbank.com/product-tour/
Page path Fires the tag when a visitor is on a page with the selected page URL and the selected event occurs in a data layer. For example, a visitor is on the page that contains the path /product-tour and the data layer event occurs. Page Path contains /product-tour
Page hostname Fires the tag when a visitor is on a page hosted on the selected domain and the selected event occurs in a data layer. For example, a visitor is on the page hosted on clearbank.com and the data layer event occurs. Page Hostname equals clearbank.com
Referrer Fires the tag when a visitor is on a page to which they were directed by the selected referrer and the selected event occurs in a data layer. This referrer is internal, meaning that it belongs to the same domain as your site. For example, a visitor comes from https://clearbank.com/blog and the data layer event occurs. Referrer equals https://clearbank.com/blog
External referrer Fires the tag when a visitor is on a page to which they were directed by the selected external referrer and the selected event occurs in a data layer. This referrer is external, meaning that it has a different domain than your site. For example, a visitor comes from https://google.com and the data layer event occurs. External referrer equals https://google.com
Campaign Fires the tag when a visitor is on a page to which they were directed by the selected campaign (based on the utm_campaign parameter) and the selected event occurs in a data layer. Campaign equals winter-promo
Traffic source

Fires the tag when a visitor is on a page to which they were directed by the selected traffic source and the selected event occurs in a data layer.

Possible values: campaign, organic search, social, referral, direct.

Traffic source equals direct
Returning visitor Fires the tag when a visitor is a returning visitor and the selected event occurs in a data layer. The returning visitor is recognized by Tag Manager, which uses the stg_returning_visitor cookie. Returning visitor is true
Variable-based conditions Any variable you add will appear in the list of conditions and you can use it to define trigger conditions. ––

Tip: Learn more about trigger conditions.

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