Hi all, I was wondering if there was a preferred installation method (for a Next.js app). I noticed the first method detailed is to dynamically load the script on the initial page load with useEffect.
The second method being the NPM SDK installation.
I am currently using the NPM method, but was wondering if there was a preferred method for performance/SEO reasons and also tracking reliability. One thing that has been puzzling me is the large amount of traffic that’s coming in without any initial referral source.
https://www.rudderstack.com/docs/user-guides/how-to-guides/rudderstack-jamstack-integration/rudderstack-nextjs-integration/#method-1-i[…]-nextjs-app
m
millions-activity-52391
09/25/2023, 4:19 PM
Hey There! 👋
Your message has been received by the RudderStack team. We will forward this request to your Technical Account Manager, and they will get back to you shortly. Please use the thread for any additional comments.
h
helpful-daybreak-79835
09/26/2023, 5:42 AM
Hello @rough-fountain-70422
Dynamically loading the script is better for performance as the script loads async and doesn't block your DOM. While the SDK is loading, you can still execute your tracking, and the SDK will pick up the buffered requests after it loads.
r
rough-fountain-70422
09/26/2023, 8:24 PM
@helpful-daybreak-79835 thanks so much for that clarification!