The Foleon platform and Foleon Docs work differently than your average web page since they are Single-Page applications (SPA). In this article, you'll learn what that means and how that impacts the integration of external platforms.
💡 Want to learn more about GTM? Read all about it in our article Using Google Tag Manager (GTM) with Foleon.
What is a Single-Page Application (SPA)?
A Single-Page Application (SPA) is a web application or website that interacts with the user by dynamically rewriting the current web page with new data, instead of the default method of a web browser loading entire new pages.
Just like Netflix and Facebook, the Foleon platform and Foleon Docs are examples of single-page applications.
The content is dynamically changed and a page change is simulated. In reality, you have stayed on the same page. That's why the Foleon platform and Foleon Docs require only a single page load, ensuring loading speed while navigating the content.
Integrating external platforms into a SPA
You might want to implement an external platform into your Foleon Docs, by injecting a script. Because Foleon Docs are single-page applications, you'll have to check if the external platform is compatible with Foleon. You can ask yourself the following questions:
- Does the platform offer support for single-page applications?
- Is there a workaround if they don't?
Let's take the implementation of the chat widget Drift as an example.
When you want to implement Drift, you can do that by adding the Drift code snippet in the remarketing field. However, the script would only fire on the first page.
Because Foleon is a SPA, the Drift code does not recognize that your audience is navigating different pages. In the image below, you can see how the script will act if you've implemented it using the remarketing field in the Foleon Doc settings.
✅ Drift itself does work and will work on every page.
❌ Drift playbooks won’t work accurately since Drift doesn’t see page changes.
In the image below, you'll see what the wanted behaviour is for your Drift chat widget.
Where the page view tag will fire once the page is loaded, the History Change trigger will fire every time the URL changes.
With the GTM process, you've now been able to adapt the setup to be compatible with Foleon as a single-page application.
💡 Want to learn more about Drift? Read all about it in our article How to implement Drift.