This article is also available in:

Custom Tracking Codes

Custom JavaScript (Tracking Codes)


Overview


The Custom JavaScript option allows you to integrate your own tracking or analytics scripts directly into your Drimify experience.

This is typically used for tools such as Facebook Pixel, Google Analytics, Google Tag Manager, or any other third-party service that requires a JavaScript snippet.

You will find this option in your project’s Settings panel, under Custom JavaScript.


⚠️ Important: Only client-side JavaScript is supported. Server-side or backend scripts cannot be used.


What You Can Use It For


You can use Custom JavaScript to:


  • Track page views and user behaviour
  • Trigger events on load or at specific steps of your experience
  • Integrate conversion tracking (e.g., Facebook Pixel events)
  • Connect your experience to analytics or marketing tools
  • Add custom logic on specific screens


This gives you full flexibility to connect Drimify to your preferred tracking ecosystem.


How to Add Your Script


  1. Open your project in the Drimify dashboard.
  2. Go to Settings.
  3. Scroll to the Custom JavaScript section.
  4. Paste your JavaScript code directly into the field.
  5. Save your settings and republish your experience.


Your script will be automatically injected into your live experience.


Example: Facebook Pixel


Here is an example of a standard Facebook Pixel tracking script you could add:


<!-- Facebook Pixel Code -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', 'YOUR_PIXEL_ID');
fbq('track', 'PageView');
</script>


Replace YOUR_PIXEL_ID with your actual Facebook Pixel ID.


Execution Scope


  • Scripts are executed in the browser of the participant.
  • The script runs after the experience has loaded, ensuring compatibility with most analytics services.


Security Notes


  • Malicious or intrusive scripts are strictly prohibited.
  • Only use JavaScript obtained from trusted providers.
  • Scripts must comply with GDPR and other relevant privacy regulations.
  • You are responsible for informing participants about any tracking or data collection.


Troubleshooting


Your script isn’t firing?


  • Make sure your code is wrapped inside <script> tags if needed.
  • Ensure there are no syntax errors.
  • For event-based tracking, confirm that your event triggers are placed correctly.
  • Check your analytics platform to confirm whether the event was received.


Need Help?


If you are unsure how to integrate a specific script, contact your tracking provider (Facebook, Google, etc.) for instructions.

If you believe your script should work but doesn’t, feel free to contact our support team with details of what you’re trying to achieve.

Updated on: 02/12/2025

Was this article helpful?

Share your feedback

Cancel

Thank you!