Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

Only load Paddle when user enters the Billing page

kruzhambuse2d6e0241c6e
diff --git a/public/index.html b/public/index.html
index d29482f8c..4187af5d3 100644
--- a/public/index.html
+++ b/public/index.html
@@ -44,7 +44,6 @@
</div>
<div id="root"></div>
<div id="intergramPlaceholder" class="flex sticky bottom-0 self-end items-end justify-end h-0 z-50" />
- <script src="https://cdn.paddle.com/paddle/paddle.js"></script>
<script>
window.intergramId = '380259923'
window.intergramServer = 'https://chat.swetrix.com'
diff --git a/src/pages/Billing/index.tsx b/src/pages/Billing/index.tsx
index 28ef299b9..33ec34a24 100644
--- a/src/pages/Billing/index.tsx
+++ b/src/pages/Billing/index.tsx
@@ -18,6 +18,15 @@ import Pricing from '../MainPage/Pricing'
dayjs.extend(utc)
dayjs.extend(duration)
+const loadPaddleScript = () => {
+ const script = document.createElement('script')
+ script.src = 'https://cdn.paddle.com/paddle/paddle.js'
+ script.async = true
+ document.body.appendChild(script)
+}
+
+loadPaddleScript()
+
const Billing = (): JSX.Element => {
const [isCancelSubModalOpened, setIsCancelSubModalOpened] = useState<boolean>(false)
const { user }: {