Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
GTM Element Visibility trigger with div style changes

I have a website with an image carousel that lets users scroll through a set of images, each appearing one at a time.

I am trying to setup an element visibility trigger in Google Tag Manager that fires every time an image appears on screen.

The site code looks like this:

<div class="c-carousel__slides row no-gutters" style="transform: translateX(-608px);")>
     <div class="col-12 c-carousel__slide">
          <div class="picture-loading c-card__pack">
               <picture>
               <img alt="alt" src="https://image1.jpg">
     <div class="col-12 c-carousel__slide">
          <div class="picture-loading c-card__pack">
               <picture>
               <img alt="alt" src="https://image2.jpg">

In Tag Manager, I can easily create a element visibility trigger, however it relies on observing DOM changes. My website HTML however, doesn't have DOM changes when user's scroll through the images - only the style element changes from 0px (starting value), to -608px, -912px, -1216px and -1520px.

With JS, I can pretty easily grab these values:

var z = document.getElementsByClassName('c-carousel__slides row no-gutters')[0].style.transform

But I am not sure how that translates into the element visibility trigger in Tag Manager:

enter image description here

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!