single click event fires rule twice | Community
Skip to main content
Level 5
September 14, 2023
Solved

single click event fires rule twice

  • September 14, 2023
  • 1 reply
  • 1851 views

single click event based on CSS selector fires rule twice in Adobe launch. I tried bubbling but didn't work. Any custom code to restrict it to one time firing?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jennifer_Dungan

Are you sure the trigger is coming from the same rule?

 

Try turning on debugging... in your Browser's console you can turn on debugging by using:

// Turn ON Debugging _satellite.setDebug(true); // Turn OFF Debugging _satellite.setDebug(false);

 

This should show you which rules are triggering on your click

 

 

The other possibility is that you have multiple Events on the same rule, and multiple of them align to your element:

 

 

 

As in, both "CSS Selector 1" and "CSS Selector 3" match your element, making the rule trigger twice.

 

Example:

  • CSS Selector 1
    • .item1
  • CSS Selector 2
    • .item2
  • CSS Selector 3
    • .item3

 

You can combine CSS Selectors into one big string to simplify this, by using:

  • .item1, .item2, .item3

(You can combine multiple selectors using comma)

 

 

Or you can add a Condition to the rule for "Max Frequency":

 

 

 

Using 1 Second should be enough, as CSS click selectors on the same element will be within milliseconds or one another, and this will allow additional subsequent hits on the same page (if the user isn't navigated away) to continue tracking.

1 reply

Jennifer_Dungan
Community Advisor and Adobe Champion
Jennifer_DunganCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
September 14, 2023

Are you sure the trigger is coming from the same rule?

 

Try turning on debugging... in your Browser's console you can turn on debugging by using:

// Turn ON Debugging _satellite.setDebug(true); // Turn OFF Debugging _satellite.setDebug(false);

 

This should show you which rules are triggering on your click

 

 

The other possibility is that you have multiple Events on the same rule, and multiple of them align to your element:

 

 

 

As in, both "CSS Selector 1" and "CSS Selector 3" match your element, making the rule trigger twice.

 

Example:

  • CSS Selector 1
    • .item1
  • CSS Selector 2
    • .item2
  • CSS Selector 3
    • .item3

 

You can combine CSS Selectors into one big string to simplify this, by using:

  • .item1, .item2, .item3

(You can combine multiple selectors using comma)

 

 

Or you can add a Condition to the rule for "Max Frequency":

 

 

 

Using 1 Second should be enough, as CSS click selectors on the same element will be within milliseconds or one another, and this will allow additional subsequent hits on the same page (if the user isn't navigated away) to continue tracking.

aagk123Author
Level 5
September 14, 2023

Another issue is when I click a link it fires an event which is fine and in turn, the event takes me to the accordion opened that opening of the accordion fires an event in adobe and it should not fire an event in Adobe because the event is set to fire only on link click. How to tackle this?

Jennifer_Dungan
Community Advisor and Adobe Champion
Community Advisor and Adobe Champion
September 14, 2023

In the same rule? Or a different rule?

 

Are you sure there is a rule for Accordion open/close in addition to your clicks?