APIs & Integrations

BiWeeklyStats
Participant

Popup not triggering on Single Page App

I have a Single Page App based on Gatsby and a few popup form are setup on some URL. When I go directly to the page concerned (First HTTP Request) I get the popup but if I navigate from another page (Client Side Routing) the popup never shows.

 

It's not because my popup has already been dismissed I have tested this multiple times on multiple browser (session incognito) and computers. The problem is the popup trigger is never met even though it should.

 

I do use the tracking script as explained in the doc to make sure it's a brand new page.

 

var path = location ? location.pathname + location.search + location.hash : undefined;
window._hsq.push(['setPath', path]);
window._hsq.push(['trackPageView']);

Is there something I'm missing?

2 Replies 2
WendyGoh
HubSpot Employee
HubSpot Employee

Popup not triggering on Single Page App

Hey @BiWeeklyStats,

 

Just to clarify, does your SPA page refresh the page url to include the query param when navigating to another page? 

 

In addition, could you share with me the following so that I can dig further into this:

 

1. Portal ID in question

2. Pop up form name in question

3. Page url in question

0 Upvotes
nickts87
Member

Popup not triggering on Single Page App

hello Wendy,

 

I have the same situation. When I access https://pixanbox.company.site/FULL-PixanBox-PRE-ORDER-p243443511 directly i get the Popup, but if access the same product from the main page https://pixanbox.company.site I don't get the popup. Can you help out?

0 Upvotes