In the next article, we will go through the most common reasons why after adding an event code to your website, it does not fire conversions in AnyTrack.
In the following article, we will go through the most common reasons why after adding an event code to your website, it does not fire conversions in AnyTrack.
The order
Remember that the order should ALWAYS be:
🔸 Anytrack global code first
🔸 Event code ( Purchase, for example) after
If your event code is before the AnyTrack tag, the browser will not be able to understand the code, and no conversion will be created.
✅ This is the correct way to insert it:
<!-- AnyTrack Tracking Code -->
<script>!function(e,t,n,s,a){(a=t.createElement(n)).async=!0,a.src="https://assets.anytrack.io/XXXXXXXX.js",(t=t.getElementsByTagName(n)[0]).parentNode.insertBefore(a,t),e[s]=e[s]||function(){(e[s].q=e[s].q||[]).push(arguments)}}(window,document,"script","AnyTrack");</script>
<!-- End AnyTrack Tracking Code -->
<script>
// trigger an outbound click event
var click_id = AnyTrack('trigger', 'OutboundClick');
</script>
Head section or Google Tag Manager
💡 AnyTrack tracking code can be located in the head section of the website or be inserted via Google Tag Manager. In case the event does not work, check if the codes are in the correct order.
→ You can check it by clicking on the right button of the mouse and opening the Inspect.
If the AnyTrack tracking code is below the event code after using Google tag manager or the head section, you can add it one more time on the specific page before the event code.
There is no problem having it twice.
Case sensitive
⚠ Event names are case sensitive, and not following this rule will inevitably trigger errors.
Writing outboundclick will not work, but OutboundClick will.
Writing Formsubmit will not work, but FormSubmit will.
Our recommendation is to copy the event name from the list:
PageView
OutboundClick
FormSubmit
AddToCart
Lead
InitiateCheckout
CompleteRegistration
Purchase
Javascript syntax
If the order and the event name are fine and you still can't trigger the event, maybe you have changed the code syntax by mistake. We recommend you remove the code and copy it one more time:
<script>
// trigger an outbound click event
var click_id = AnyTrack('trigger', 'OutboundClick');
</script>
Including a code line into a comment
In case you paste the code in this way, it will not work:
<script>
// trigger an outbound click event var click_id = AnyTrack('trigger', 'OutboundClick');
</script>
This sign // means that the line is a comment and the browser has to avoid it. In case you change the way the paragraph looks, you may insert essential code lines into a comment.
The easiest solution is to paste it exactly the way it looks here in the article.
Need support?
Questions? Problems? Need more info? Contact Anytrack Support for assistance!