Forward to thank you page after request
Question
> Is it possible to send the customer back to the website after the "Request" button, after the customer has sent all the data? So that he comes to a thank you page in the URL?
Answer
The K3 does not have a built-in redirect feature. However, you can implement the redirect yourself via a JavaScript event.
Solution approach with JavaScript
After saving a configuration, the K3 sends the event K3ConfigurationSaved via window.postMessage. You can intercept this event on your website and then trigger a redirect.
window.addEventListener("message", function (event) {
// Prüfen ob es ein K3-Event ist
if (event.data && event.data.type === "K3ConfigurationSaved") {
// Optional: Nur bei bestimmten Aktionen weiterleiten (z.B. nur bei "email")
if (event.data.actionKey === "email") {
// Weiterleitung auf Ihre Dankesseite
window.location.href = "https://ihre-website.de/danke/";
}
}
});
What does the event contain?
The K3ConfigurationSaved event contains the following information:
actionKey: Type of action, e.g."email","cart","pdf"code: The unique configuration codecustomer: The customer data entered (name, e-mail, etc.)
You can also transfer this data to your thank you page:
window.addEventListener("message", function (event) {
if (event.data && event.data.type === "K3ConfigurationSaved") {
// Konfigurations-Code an Dankesseite übergeben
const code = event.data.code;
window.location.href = `https://ihre-website.de/danke/?code=${code}`;
}
});
This solution works both with IFrame integration and with the Web Component (preferred). When integrating as a simple link, you do not have access to the JavaScript events.
Alternative: Use shopping cart action
If you have set up a Warenkorb-Integration, the user will automatically land in your store - where you can then display a confirmation page.
Further information
- Google Tag Manager Integration - Overview of all available K3 events
- Konfigurator einbinden - IFrame integration and event handling
- Abschluss-Aktionen konfigurieren - Inquiry, shopping cart and other actions
Related topics
- Intercepting JavaScript events
- postMessage communication
- IFrame integration