Sireini
Sireini

Reputation: 4262

Is it possible to stop slick slider from autoplay within a google tag manager tag?

I am wondering if it is possible to stop a slick slider from autoplay with a tag in google tag manager because the .slick is not accessible. I'll hope someone could clear this out for me :)

I am working on a site where I need to ab test and want to stop the slick slider from autoplay, but I don't think the slick instance accessible from this tag?

Upvotes: 0

Views: 290

Answers (1)

Matus
Matus

Reputation: 1418

With GTM you have access to DOM, for example via Cutom HTML tag so you can definitely change anything within the page. (Useful Link to google support pages: here)

To do this you can create a new Custom HTML Tag:

<script>
$('.yourAutoplaySlickElement').slick("slickPause"); 
</script>

Just make sure this tag is triggered after your slick element was initialized.

Upvotes: 1

Related Questions