/lovable-integrations

Lovable and Crazy Egg integration: Step-by-Step Guide 2025

Discover how to easily integrate Lovable with Crazy Egg. Follow our step-by-step guide to unlock valuable insights and boost your website’s conversion rates.

Matt Graham, CEO of Rapid Developers

Book a call with an Expert

Starting a new venture? Need to upgrade your web app? RapidDev builds application with your growth in mind.

Book a free No-Code consultation

How to integrate Lovable with Crazy Egg?

 

Step 1: Creating the Crazy Egg Integration File

 

In your Lovable project, create a new TypeScript file to manage the Crazy Egg integration. For example, create a new file named crazyEgg.ts in your src/integrations/ folder. If the integrations folder does not exist, create it.


export function initializeCrazyEgg(): void {
  const script = document.createElement("script");
  script.type = "text/javascript";
  script.async = true;
  // Replace the URL below with your Crazy Egg script source, including any parameters Crazy Egg requires
  script.src = "https://dnn506yrbagrg.cloudfront.net/pages/scripts/0012/1234.js?" + Math.floor(new Date().getTime() / 3600000);
  document.head.appendChild(script);
}

This file defines a function that creates and appends the Crazy Egg script tag to your document header, ensuring that Crazy Egg will load asynchronously upon initialization.

 

Step 2: Calling the Integration Code

 

In your Lovable application's main entry file (for example, index.ts or app.ts), you need to import and call the initializeCrazyEgg function. This ensures that when your application starts, the Crazy Egg tracker is loaded automatically.


import { initializeCrazyEgg } from "./integrations/crazyEgg";

// Call the function during app initialization
initializeCrazyEgg();

// Continue with the rest of your application initialization code

Place the import and function call at the beginning of your entry file. This guarantees that Crazy Egg is set up as soon as the application starts running.

 

Step 3: Handling Dependencies Without a Terminal

 

Since Lovable does not provide a terminal for dependency installation, you must include any external libraries by adding their CDN links or embedding them directly in your code if needed. For the Crazy Egg integration, no external npm packages are necessary because we are inserting a script tag manually.

If in the future you need to rely on an external module, check if Lovable allows you to add script tags in your index.html file. Otherwise, you can include the library’s UMD build via a CDN link within your project’s HTML file.

 

Step 4: Verifying the Integration

 

After inserting the above snippets, verify that Crazy Egg is loaded. You can do so by:


// When the page loads, open the browser console and type:
console.log(document.querySelector('script[src*="pages/scripts"]'));
// This should log the Crazy Egg script element if it was added successfully.

This confirmation step helps ensure that your Crazy Egg integration is working correctly.

 

Step 5: Final Adjustments and Testing

 

Once you are satisfied with the integration, test your Lovable project thoroughly by:


// Ensure all parts of your app work as expected
window.addEventListener("load", () => {
  // Optionally, log that Crazy Egg has been initiated
  console.log("Crazy Egg integration loaded");
});

Review your changes, save the files, and refresh your Lovable project to see the Crazy Egg analytics starting to work.

 

Still stuck?
Copy this prompt into ChatGPT and get a clear, personalized explanation.

This prompt helps an AI assistant understand your setup and guide you through the fix step by step, without assuming technical knowledge.

AI AI Prompt

Want to explore opportunities to work with us?

Connect with our team to unlock the full potential of no-code solutions with a no-commitment consultation!

Book a Free Consultation

Client trust and success are our top priorities

When it comes to serving you, we sweat the little things. That’s why our work makes a big impact.

Rapid Dev was an exceptional project management organization and the best development collaborators I've had the pleasure of working with. They do complex work on extremely fast timelines and effectively manage the testing and pre-launch process to deliver the best possible product. I'm extremely impressed with their execution ability.

CPO, Praction - Arkady Sokolov

May 2, 2023

Working with Matt was comparable to having another co-founder on the team, but without the commitment or cost. He has a strategic mindset and willing to change the scope of the project in real time based on the needs of the client. A true strategic thought partner!

Co-Founder, Arc - Donald Muir

Dec 27, 2022

Rapid Dev are 10/10, excellent communicators - the best I've ever encountered in the tech dev space. They always go the extra mile, they genuinely care, they respond quickly, they're flexible, adaptable and their enthusiasm is amazing.

Co-CEO, Grantify - Mat Westergreen-Thorne

Oct 15, 2022

Rapid Dev is an excellent developer for no-code and low-code solutions.
We’ve had great success since launching the platform in November 2023. In a few months, we’ve gained over 1,000 new active users. We’ve also secured several dozen bookings on the platform and seen about 70% new user month-over-month growth since the launch.

Co-Founder, Church Real Estate Marketplace - Emmanuel Brown

May 1, 2024 

Matt’s dedication to executing our vision and his commitment to the project deadline were impressive. 
This was such a specific project, and Matt really delivered. We worked with a really fast turnaround, and he always delivered. The site was a perfect prop for us!

Production Manager, Media Production Company - Samantha Fekete

Sep 23, 2022