# Can "page" as data layer variable name in custom events have side effects?

**URL:** <https://community.piwik.pro/t/can-page-as-data-layer-variable-name-in-custom-events-have-side-effects/1664>\
**Category:** Data collection and tags\
**Created:** [February 21, 2023, 2:18pm UTC](https://community.piwik.pro/t/can-page-as-data-layer-variable-name-in-custom-events-have-side-effects/1664 "2023-02-21T14:18:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![brutpaul](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@brutpaul](https://community.piwik.pro/u/brutpaul)\
**Post date:** [February 21, 2023, 2:18pm UTC](https://community.piwik.pro/t/can-page-as-data-layer-variable-name-in-custom-events-have-side-effects/1664/1 "2023-02-21T14:18:31Z")

</div>

Hi there,

we’ve wrongly used “page” as a data layer variable name for some custom events. Could it be that using “page” as a variable in custom events can lead to wrong pageviews?

We’ve noticed that issue because we’ve had these wrong “page” variable names in some pageview reports.

 ![Screenshot 2023-02-21 at 15.13.21](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/6/680ae5c90cbe1507982b4e65bb2372c3a428055d.png)

Thanks,  
Paul

---

<div class="post-metadata">

**Author:** ![kuba](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/kuba/32/7_2.png) [@kuba](https://community.piwik.pro/u/kuba)\
**Post date:** [February 21, 2023, 3:05pm UTC](https://community.piwik.pro/t/can-page-as-data-layer-variable-name-in-custom-events-have-side-effects/1664/2 "2023-02-21T15:05:35Z")

</div>

Hi. What issues with tracking did you observe after setting up this variable?

---

<div class="post-metadata">

**Author:** ![brutpaul](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@brutpaul](https://community.piwik.pro/u/brutpaul)\
**Post date:** [February 22, 2023, 12:27pm UTC](https://community.piwik.pro/t/can-page-as-data-layer-variable-name-in-custom-events-have-side-effects/1664/3 "2023-02-22T12:27:27Z")

</div>

So we have custom event for our ads impressions with a variable “page” giving us the information which ads has sent the event:

 ![Screenshot 2023-02-22 at 13.07.16](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/4/489018797968e326189cc7d93b51ceae48607969.png)  
 ![Screenshot 2023-02-22 at 13.07.51](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/e/edc4b01989355dd3bbb6ae9ccb47761744f02f67.png)

And the problem is that these variables are somehow counted and shown in a pageview report, even though we have a filter condition that in these reports only page views should be shown:

 ![Screenshot 2023-02-22 at 13.08.49](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/6/619135b9fd6d1bbab50af75fb41ea30f69403013.png)

But somehow the page variable is shown in the reports:

 ![Screenshot 2023-02-22 at 13.08.32](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/9/902e6ecb2423faae9de33449946a232e5541f460.png)

After investigating again I think I found the issue. Piwik standard events are using some wrong variables and therefore the page variable is shown in the page view report:

- stg.pageView
- stg.pageLoad
- stg.scroll
- stg.timer
- stg.\*

Here an example for the event “stg.scroll”

 ![Screenshot 2023-02-22 at 13.20.35](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/d/d223037adba91147b2b3e54a04f271e33d8e4476.png)  
 ![Screenshot 2023-02-22 at 13.20.30](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/6/607ac751e0b5263a52473f708979efb5357761a9.png)  
 ![Screenshot 2023-02-22 at 13.20.19](https://europe1.discourse-cdn.com/flex005/uploads/piwikpro/original/2X/a/a30769298375ecd2bf3de8a54733696f89ae56dd.png)

So my follow-up question here 😃 how can we modify the variables for piwik standard events?

---

<div class="post-metadata">

**Author:** ![kuba](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/kuba/32/7_2.png) [@kuba](https://community.piwik.pro/u/kuba)\
**Post date:** [February 22, 2023, 1:28pm UTC](https://community.piwik.pro/t/can-page-as-data-layer-variable-name-in-custom-events-have-side-effects/1664/4 "2023-02-22T13:28:48Z")

</div>

If you define a variable, it’s available for all event types. Same with defining some datalayer structure. The thing is that the defined variables by default shouldn’t be used at all unless there are some issues with configuration.

As for your last screenshot, if you want to effectively filter out something, you have to use AND condition.

---

<div class="post-metadata">

**Author:** ![brutpaul](https://avatars.discourse-cdn.com/v4/letter/b/35a633/32.png) [@brutpaul](https://community.piwik.pro/u/brutpaul)\
**Post date:** [February 23, 2023, 2:20pm UTC](https://community.piwik.pro/t/can-page-as-data-layer-variable-name-in-custom-events-have-side-effects/1664/5 "2023-02-23T14:20:11Z")

</div>

I think we found a solution to our issue → we have given our ads different variable names (which we don’t use in our page views reports) and therefore the variables aren’t shown anymore in the reports.

Thanks!
