rough-jelly-19343
08/21/2023, 9:19 PMwindow.dataLayer that is created by the google ads tag, then it works fine. My suspicion is the rudderstack is doing something async and not immediately dispatching before the navigation event occurs and it’s unloaded. Wondering if anyone else has run into thismillions-activity-52391
08/21/2023, 9:19 PMmillions-activity-52391
08/22/2023, 1:05 PMrough-jelly-19343
08/22/2023, 1:09 PMfunction onLinkClick() {
window.rudderanalytics?.track("my-custom-event");
window.dataLayer?.push("event", "conversion", { send_to: "..." });
}
In the google analytics debugger, I see the conversion event, but not the conversion event that i’ve mapped to “my-custom-event” in the rudderstack UImillions-activity-52391
08/22/2023, 1:56 PM`window.dataLayer?.push("event", "conversion", { send_to: "..." });`rough-jelly-19343
08/22/2023, 2:02 PMwindow.rudderanalytics?.track("my-custom-event");
then I’m not seeing the events in logs. If I replace it with the dataLayer push, I see the log. It’s also weird because this only happens in production mode. If i’m running nextjs in development mode, it dispatches fine as well.rough-jelly-19343
08/22/2023, 2:03 PMmillions-activity-52391
08/22/2023, 2:04 PM`window.rudderanalytics.track("my-custom-event");`rough-jelly-19343
08/22/2023, 2:06 PMrough-jelly-19343
08/22/2023, 2:09 PMrough-jelly-19343
08/22/2023, 2:20 PMrough-jelly-19343
08/22/2023, 2:21 PMrough-jelly-19343
08/22/2023, 2:31 PMrudder-sdk-js package in nextjs without it complaining about window not existingmillions-activity-52391
08/22/2023, 3:01 PMrough-jelly-19343
08/22/2023, 3:02 PMnpm run dev, but it blows up in npm run buildrough-jelly-19343
08/22/2023, 3:03 PMmillions-activity-52391
08/22/2023, 3:09 PMrough-jelly-19343
08/22/2023, 3:10 PMrough-jelly-19343
08/22/2023, 3:10 PM?, since we can’t guarantee it exists, since it has to load separatelymillions-activity-52391
08/22/2023, 3:26 PMrough-jelly-19343
08/22/2023, 3:27 PM