Hi,
I can see the launch page load rule is firing twice in the debugger on one page load. I have put two Event: Window loaded and Data Element Change. If both the events are met, then the server call is firing twice. Please suggest if i should remove one of the event from the rule or there is another workaround. Attached is the screenshot of the rule.
Regards
Akshay
Solved! Go to Solution.
Views
Replies
Total Likes
So from your description, it seems like the window load event is unnecessary. Assuming your website is a single-page-application website, if your website uses a common SPA framework such as ReactJS or Angular where each view should have a history change event you can use, then you don't need to monitor the page name data element.
You must confirm if the page name data element will change even on the initial page load. This is a common issue for SPA applications should the first page view be tracked by page load event, history change event, or data element change event.
Views
Replies
Total Likes
In your example, it appears that your rule is set up to fire when both the "Window Loaded" and the "Data Element Change" events occur. If both of these occurrences occur on the same page load, the rule may be triggered twice.
You might explore a few alternative workarounds:
Remove one of the events: If you can achieve the same functionality with only one of the events triggering the rule, you might want to consider eliminating the other event to avoid duplicate firing.
You may add a condition to the rule that restricts it from triggering multiple times on the same page load. For example, you might add a condition to the rule that only allows it to fire if a custom data element that tracks whether the rule has previously fired is not set.
Use an alternative event: Depending on the goal of the rule, you might be able to use a different event that is less likely to trigger numerous times on the same page load. You might, for example, implement a custom event that is only triggered when a certain action on the page is taken.
Views
Replies
Total Likes
What data element change you are monitoring? Since this rule has two events, it is just working as expected that it will trigger twice or even more depending on how many times that data element had changed.
Views
Replies
Total Likes
I am monitoring the page name change in the data element. and it is happening once on every page.
Views
Replies
Total Likes
So from your description, it seems like the window load event is unnecessary. Assuming your website is a single-page-application website, if your website uses a common SPA framework such as ReactJS or Angular where each view should have a history change event you can use, then you don't need to monitor the page name data element.
You must confirm if the page name data element will change even on the initial page load. This is a common issue for SPA applications should the first page view be tracked by page load event, history change event, or data element change event.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Like
Replies
Views
Likes
Replies
Views
Likes
Replies