Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Launch track link page

1982luca
Level 8
Level 8

Read

Hello everyone,

 

Any suggestion how to track li with href?

 

 

1982luca_0-1605513120645.png

 

1 Accepted Solution
evolytics_brian
Correct answer by
Community Advisor
Community Advisor

@1982luca - If you're looking to track clicks on the <a> tags that are found in your list, you can do this with a Launch rule. Your rule, with CSS selector, may look something like this:

evolytics_brian_1-1605559989417.png

Using "div#dashboard-deals li a" will pick up any/every <a> tag that falls under a <li> inside your div. This assumes the following page structure (from your image):

...
...
  <div class="collapse" id="dashboard-deals">
    <ul>
      <li><a href="/someLink1.html">some text 1</a></li>
      <li><a href="/someLink2.html">some text 2</a></li>
      <li><a href="/someLink3.html">some text 3</a></li>
      <li><a href="/someLink4.html">some text 4</a></li>
    </ul>
  </div>
...
...

From there, you'd set up the rest of your rule as you normally would.

 

View solution in original post

1 Reply
yuhuisg
Community Advisor
Community Advisor

Are you saying that inside the <li>, there is no <a> element?

1982luca
Level 8
Level 8
Yes, i have this <a href="">XXX<a/>
evolytics_brian
Correct answer by
Community Advisor
Community Advisor

@1982luca - If you're looking to track clicks on the <a> tags that are found in your list, you can do this with a Launch rule. Your rule, with CSS selector, may look something like this:

evolytics_brian_1-1605559989417.png

Using "div#dashboard-deals li a" will pick up any/every <a> tag that falls under a <li> inside your div. This assumes the following page structure (from your image):

...
...
  <div class="collapse" id="dashboard-deals">
    <ul>
      <li><a href="/someLink1.html">some text 1</a></li>
      <li><a href="/someLink2.html">some text 2</a></li>
      <li><a href="/someLink3.html">some text 3</a></li>
      <li><a href="/someLink4.html">some text 4</a></li>
    </ul>
  </div>
...
...

From there, you'd set up the rest of your rule as you normally would.

 

View solution in original post