- First Part of Code (Header):
The first part of the integration code, which is typically used for initialization or setup, should be placed in
<head>section of your HTML document. This ensures that the required scripts and configurations are loaded before the rest of the page content.
Here's an example of where you should place the first part of the code:
- Second Part of Code (Particular Pages):
The second part of the integration code, which is specific to certain pages or actions, should be placed in the
relevant sections of your HTML where you want the events to be triggered and sent to Tracardi. This code is often
<script>tags at the bottom of the page, just before the closing
</body>tag. This ensures that the page content is loaded first before the script executes.
Here's an example of where you should place the second part of the code:
<!DOCTYPE html> <html> <head> <title>Your Webpage Title</title> <script src="path/to/your-first-part-code.js"></script> </head> <body> <!-- Your webpage content goes here --> <!-- Place the second part of the integration code within the script tag below --> <script> // Your second part of the integration code here // This code will be specific to certain pages or actions // and will send events to Tracardi as intended. </script> </body> </html>
In the code above, the second part of the integration code is placed within the