Google跟踪代码管理器:选择深层嵌套的

时间:2018-04-12 16:01:42

标签: google-tag-manager

我试图抓住所有锚点击。

在GTM中,我的触发器是:

 All Elements / Some Clicks / Click Element / Matches CSS Selector / #most-popular-posts > a

我已经尝试了#most-popular-posts> *>一个没有运气。关于为什么这不起作用的任何想法?

我的HTML如下:

 <div id="most-popular-posts">
    <h4>Most Popular</h4>
    <div class="post-loop">
        <ul>
            <li>
                <a class="latest_thumbnail_wrapper" href="http://thelink.com">
                    <div class="latest_thumbnail">
                        <img src="https://theimage.jpg" class="attachment-loop-thumbnail size-loop-thumbnail wp-post-image" alt="">                         
                    </div>
                </a>
                <div class="latest_list_wrapper">
                    <h5 class="cat-label"><a href="https://cateogrylink.com">The Category</a></h5>
                    <h3>
                        <a href="hhttp://thelink.com">Article Title</a>
                    </h3>
                    <div class="byline">  
                        <span>by</span> <a class="author" href="">First Last Name</a></div>
                    </div>
                </li>
            <li>
        </ul>
    </div>
 </div>

1 个答案:

答案 0 :(得分:0)

从选择器中删除@Entity public class Grade { @GeneratedValue(strategy = GenerationType.AUTO) @Id private long id; private int moduleid; private int studentid; private double grade; public int getModuleid() { return moduleid; } public void setModuleid(int moduleid) { this.moduleid = moduleid; } public int getStudentid() { return studentid; } public void setStudentid(int studentid) { this.studentid = studentid; } public double getGrade() { return grade; } public void setGrade(double grade) { this.grade = grade; } } 。这将查找>元素内的任何<a>标记,而不是直接嵌套在该元素内的#most-popular-posts

有关详细信息,请参阅此Mozilla文章:https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Cascade_and_inheritance