PageSourceSearch

https://www.rapidspike.com/wp-content/themes/rapidspike-www-theme-2024/assets/js/main.js

js rapidspike.com collected 2026-09-24 19:50:29 UTC 1,749 bytes, 47 lines download raw bytes

1document.addEventListener("DOMContentLoaded", function () {
2    const kadenceForms = document.querySelectorAll(".cs-signup-email form");
3
4    const currentParams = new URLSearchParams(window.location.search);
5    currentParams.delete("email");
6
7    function sanitizeParam(param) {
8        return param.replace(/[^\w\-@.%]/gi, "");
9    }
10
11    kadenceForms.forEach(function (form) {
12        form.addEventListener("submit", function (event) {
13            event.preventDefault();
14
15            const emailInput = form.querySelector("input[type='email']");
16
17            if (emailInput && emailInput.value) {
18                const sanitizedEmail = sanitizeParam(emailInput.value);
19                currentParams.set("email", sanitizedEmail);
20
21                const redirectURL = "https://cartshark.rapidspike.com/register?" + currentParams.toString();
22
23                // Fire GTM/analytics
24                if (window.dataLayer) {
25                    window.dataLayer.push({
26                        event: "start_trial_click",
27                        email: sanitizedEmail,
28                        campaign: {
29                            source: currentParams.get("utm_source") || null,
30                            medium: currentParams.get("utm_medium") || null,
31                            campaign: currentParams.get("utm_campaign") || null,
32                            content: currentParams.get("utm_content") || null
33                        }
34                    });
35                }
36
37                // Delay redirect to allow tracking
38                setTimeout(function () {
39                    window.location.href = redirectURL;
40                }, 400);
41
42            } else {
43                form.submit();
44            }
45        });
46    });
47});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.