Knowledge Base      


How do I fire conversions with Single Page Applications (SPAs)?


When we designed ClickMagick, we envisioned users putting tracking pixels and Campaign Tracking code on separate pages so that as visitors to your website moved from page to page you could track their progress through your funnel.

But with single page applications built using JavaScript frameworks like Angular, Vue, and React, to name a few, the concept of a “page” isn’t quite the same.

With a single page application, the page is only loaded once and then moving from page-to-page is simulated by adding and removing different page elements to the original page. In reality, the website is just a single page that dynamically changes as the user clicks on buttons or other page elements.

So, how exactly do you process “multi-page” conversions when your website is just a single page?

It’s pretty easy, actually.

As your single page application executes its JavaScript code to simulate moving from one page to the next, you simply add one extra JavaScript call to our ClickMagick log() function to post a conversion. That’s it. Just a simple call.

To get the specifics about how to set this up for either tracking links or for Campaigns, read this article:

Can I record a conversion or goal using JavaScript?

Article 754 Last updated: 10/14/2021 4:27:31 PM
https://www.clickmagick.com/kb/?article=754