Actions can now be tracked with more accuracy and consistency
This article is a part of our legacy installation and does not apply to our Funnelytics 2.0 Performance Platform
We've released some improvements to the tracking script that will now make your action tracking better.
This update comes with 2 parts:
- Action Queueing
- Guaranteed action delivery
Action Queueing
This allows actions to be still be triggered even if the full Funnelytics library hasn't been loaded yet. This would typically happen if an action was set to be triggered on the exact same event that the base script is set to be triggered (like a pageview).
If both the action script and the base script were loading at the same time, the action would fail.
Guaranteed Action Delivery
Previously, if an action was set to be triggered on a button click or other behavior that happened close to a browser transition (like opening a new page or even just closing the tab) it was possible that the action would not be triggered on the page before the transition happened.
Actions now utilize a browser API that guarantees the action event data will be sent to our servers before a transition happens.
Changes You Need To Make
There are two changes that you need to be aware of in order to take full advantage of these new features.
- You need to update the base tracking script on your page. In your workspace settings where the tracking script lives, you need to copy the script and replace it with the old one on your site. The old script will work as normal, but without the new script you won't have the advantage of queuing actions.
- You need to make sure that your actions don't have a return function. Previously, a lot of our documentation included an empty function as a callback for when the event was successfully or unsuccessfully received by our servers.
It looked like this:<script type='text/javascript'>
window.funnelytics.events.trigger("click", {
button: "top_cta"
}, function() { });
</script>(line 4 contains the empty callback function)
For new actions to take advantage of the guaranteed delivery, they should not contain the callback. Here's an example of the same event without the callback:<script type='text/javascript'>
window.funnelytics.events.trigger("click", {
button: "top_cta"
});
</script>We've updated our documentation as well so that any examples no longer include the callback function.
Additional Resources
Learn more about features mentioned in this article: