Hi… I am looking to implement rudderstack within a...
# support
c
Hi… I am looking to implement rudderstack within a Next.js app. I have followed the basic instructions and can fire events. Do you have any recommendations on how to implement in order to only fire 1 page view each time a page loads?
m
Hey There! 👋 Your message has been received by the RudderStack team. Our standard customer support hours are 9-6 PM EST, but 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.
Hi Jim the default setup we have is to fire only one page call every time the page loads. However, if we do not get a response for a particular event, we may trigger the event again (RudderStack tries to guarantees that each event is sent atleast once). If you are seeing 2 page events on every page load, one of them is probably the preflight request (Request type: OPTIONS) and this does not count towards your event volumes.
c
okay, but will I end up with 2 page views in say GA4?
m
No the preflight request will not show up in the live-events either and is not sent to the destination.
c
So.. I end up with this
I get 2 events occurring simultaneously (~2ms apart)
m
So how often do you see this?
c
2 times each page load
m
Have you instrumented your own Page call? By default RudderStack sends a Page call. Also can you provide the website url?
c
Screen Shot 2023-12-19 at 1.28.59 PM.png
it’s running locally
ah… okay
okay, I didn’t know the page call is sent automatically
that is helpful. Thank you.
m
Thanks :)
c
One more re: next.js install-> Is there a more efficient way to include the tag as opposed to including it on each page? If I include in _app.tsx it won’t load. Do I have to initialize on each page?
m
Share a sample implementation on the other thread