当elementID变化时,如何在GTM中使用元素可见性

发布于 2025-02-06 14:55:48 字数 651 浏览 1 评论 0原文

我需要在Angular应用程序中使用GTM获取预览计数。属性在循环内部如下所示。

<div *ngFor="let ad of advertisementsArray">
 <div id="ad.adid" class="card">
   <span class="tag">ad</span>
   <h5 class="card-header">{{ad.adtitle}}</h5>
   <img [src]="ad.imageLink" class="card-img-top" alt="...">
   <div class="card-body" data-bs-toggle="tooltip" data-bs-placement="bottom"
      title="{{ad.addescription}}">
      <p class="card-text">{{ad.addescription}}</p>
  </div>
</div>

您首先是循环。第二是我需要获得计数的那个。但是在GTM中,我们需要将元素ID( id )添加到以下空间。

因此,我需要知道如何在不给出恒定ID号的情况下分别触发元素?

I need to get the preview count using GTM in my Angular application. properties are changing inside a loop like below.

<div *ngFor="let ad of advertisementsArray">
 <div id="ad.adid" class="card">
   <span class="tag">ad</span>
   <h5 class="card-header">{{ad.adtitle}}</h5>
   <img [src]="ad.imageLink" class="card-img-top" alt="...">
   <div class="card-body" data-bs-toggle="tooltip" data-bs-placement="bottom"
      title="{{ad.addescription}}">
      <p class="card-text">{{ad.addescription}}</p>
  </div>
</div>

As you can first is the for a loop. Second is the one which I need to get the count. But in GTM we need to add the element ID (id) to the following space.

So I need to know how can I fire the elements separately without giving a constant ID number?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文