Tracking Click and Page View Events across multi-page + SPA
Hi all.
I am attempting to track click and page view events in an AB test I'm running. However, I'm having some issues as the site we are working on is both a multi-page and a SPA website.
In the test, we are primarily tracking a button click from the home page, which navigates the user to a separate page in the site.
This new page operates essentially as a SPA, it has a funnel the user goes through similar to a "quote" application process, but it is all one page with sequential endpoints as "steps" in the process.
TLDR
- Selection events aren't re-attaching to the page on a multi-page + SPA solution
- Better way to force attach selection events than getOffers/applyOffers?
- getOffers/applyOffers is executed every time the url changes on an event listener
- Click tracking on nav menu in the home page is not consistent at all in live audience mode
- Is it possible that this is due to navigation happening too quick for target to log the event?
More Information
We have a primary goal (tracking button clicks on a CTA on the home page) as well as several sub-metrics (tracking each submit button clicked throughout the quote user funnel)
I'm running into the following issues when tracking:
- On the home page, the selection event is attached to the button normally (on page load event), submit button for the first step is also attached after navigation
- However, once the user navigates through the funnel, Target does not re-apply the metric selection events to the rest of the steps in the funnel ( as the url changes but the page does not re-load due to it being a SPA)
- Therefore, we get (albeit inconsistent) results from the first two metrics in the quote process, but none of the rest of the tracking occurs for the other steps
- To fix the above, I added a getOffers/applyOffers code snippet every time the url changes in the funnel
- This essentially treats every url change as a new page load event, re-attaching the click event listeners as expected throughout the funnel
- However, this is seen as a bandaid, and creates many callouts to Target that we don't need to track
- Any advice on tackling the above? I could narrow down the getOffers/ApplyOffers callout
- Another issue, the button click on the homepage seems very inconsistent.
- In QA mode, the button click is tracked properly
- In live audience mode, the button click is tracked way less than the rest of the steps in the funnel
- eg maybe 4-5 button clicks were tracked, but over 100 people made it through the funnel
- indicating either the click event wasn't tracked for these users or they navigated to the rest of the funnel from other means
- Is it possible that the click navigation is happening too quickly for target to capture the click event? Thus forcing the event to cancel?
- Also, is it possible for a user to trigger metrics from manually navigating to the pages (for page view metrics)? Our intention is to only track users that have clicked the nav button initially, not track from anywhere else
Thank you, I hope someone can shed some light on this! I'm happy to provide any code snippets/configuration details if needed.