# How to track element visibility

**URL:** <https://community.piwik.pro/t/how-to-track-element-visibility/1737>\
**Category:** Data collection and tags\
**Created:** [March 6, 2023, 4:39pm UTC](https://community.piwik.pro/t/how-to-track-element-visibility/1737 "2023-03-06T16:39:07Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjsmartins](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/jjsmartins/32/1210_2.png) [@jjsmartins](https://community.piwik.pro/u/jjsmartins)\
**Post date:** [March 6, 2023, 4:39pm UTC](https://community.piwik.pro/t/how-to-track-element-visibility/1737/1 "2023-03-06T16:39:07Z")

</div>

I want to track element visibility, but I don’t know how to create this trigger using Tag Manager. Something like: if an element (link, CTA, image, etc) is on the user’s viewport by at least X%, it triggers an event.

I know that Tag Manager let’s me use element presence as a trigger, but this is not what I want, I need it to not just be present in the page, but actually visible in the viewport.

Right now I was only able to do this using Google Tag Manager. Is there anyway I can do it in Tag Manager?

---

<div class="post-metadata">

**Author:** ![Admin](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Admin](https://community.piwik.pro/u/Admin)\
**Post date:** [March 6, 2023, 5:02pm UTC](https://community.piwik.pro/t/how-to-track-element-visibility/1737/2 "2023-03-06T17:02:00Z")

</div>

Hi. Maybe taking a step back, what would you like to achieve by using this trigger? If it’s all about measuring the views of a particular content part, maybe content tracking would be a solution for you: [How can I track interactions with popups and content? | Piwik PRO help center](https://help.piwik.pro/support/questions/set-up-content-tracking/)

---

<div class="post-metadata">

**Author:** ![jjsmartins](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/jjsmartins/32/1210_2.png) [@jjsmartins](https://community.piwik.pro/u/jjsmartins)\
**Post date:** [March 6, 2023, 5:43pm UTC](https://community.piwik.pro/t/how-to-track-element-visibility/1737/3 "2023-03-06T17:43:58Z")

</div>

I can’t use content interaction because I can’t add the attributes to the code without development help and right now that’s not possible. So I really need another way.

---

<div class="post-metadata">

**Author:** ![Admin](https://avatars.discourse-cdn.com/v4/letter/a/3ec8ea/32.png) [@Admin](https://community.piwik.pro/u/Admin)\
**Post date:** [March 8, 2023, 10:55am UTC](https://community.piwik.pro/t/how-to-track-element-visibility/1737/4 "2023-03-08T10:55:27Z")

</div>

We don’t have any out of the box functionality for that in Tag Manager. The only solution is to write custom js code that would handle that.

---

<div class="post-metadata">

**Author:** ![mbaersch](https://dub1.discourse-cdn.com/flex005/user_avatar/community.piwik.pro/mbaersch/32/35_2.png) [@mbaersch](https://community.piwik.pro/u/mbaersch)\
**Post date:** [March 8, 2023, 8:28pm UTC](https://community.piwik.pro/t/how-to-track-element-visibility/1737/5 "2023-03-08T20:28:35Z")

</div>

Hi,

Maybe this article can help you to set something up using Mutation Observers when you translate it: [Bedingte Element-Sichtbarkeit im Piwik PRO Tag Manager vermessen | 📊 Blog Markus Baersch](https://www.markus-baersch.de/blog/bedingte-element-sichtbarkeit-im-piwik-pro-tag-manager-vermessen/)

best,  
Markus
