- Help Center
- Configuration
- Troubleshooting
-
Getting Started
-
Configuration
- Targeting
- Split URL
- Product Testing
- Full Stack
- Experiment Management
- CSP Configuration
- Experiment Execution
- Reports
- Exit Popups
- GTM Integration
- Troubleshooting
- Performance Optimization
- Event-Triggered Changes
- Holdout Groups
- Split URL Pages
- URL Parameters
- DataLayer
- Menu Configurations
- Traffic Exclusion
- Experiment Scheduling
- Dynamic Element Changes
- Price Targeting
- Experience Scheduling
- Privacy
- Hash Changes
- Async Tracking
- Selective Installation
- CSS Selectors
- Vue.js Integration
- Page Content
- Multipage Split URL
- Organic Traffic
- Visual Editor
- Server-Side Testing
- Traffic Bucketing
- GDPR Warnings
- Statistical Confidence
- Browser Privacy
- Query Parameters
- Embedded Videos
- Tracking Code Execution
- Simultaneous Experiments
- Tags
- Deployments
- Disable Testing
- Locations
- Programmatic Bucketting
- Query Parameter Handling
- Convert Library
- Variation Previews
- Experiment Editing
- Opt-Out Script
- Data Reset
- Body Hiding
- Visit-Specific Variations
- Variation Styling
- Preview Issues
- Variation Editing
- Full-Site Testing
- Blinking Variations
- Cross-Domain Cookies
- Regex Support
- Conversion Tracking
- SPA Testing
- Project Setup
- Cross-Domain Tracking
- Geo-Targeting
- Analytics Tools
- Campaign Tags
- Previewing
- IDs
- Query String Targeting
- Bounce Rate Goals
- Bot Filtering
- Query String Variables
- Custom Audiences
- Redirects
- Baseline
- Tracking Code Location
- Secure Cookies
- AngularJS
- Cloudflare
- Code Installation
-
Track Goals
- Form Tracking
- Cookie Management
- iFrame Click Tracking
- Performance Optimization
- Revenue Tracking
- Interaction Goals
- Form Submissions
- Advanced Goals
- Lazy Loading
- Multi-Conversions
- URL Parameters
- Bounce Rate Goals
- DataLayer Integration
- Scroll Depth
- Social Interactions
- Page Views
- Marketo Forms
- Feature Analysis
- AJAX Forms
- Revenue Tracking via GTM
- Order Outliers
- Cumulative Revenue
- Goal Templates
- Adding Revenue Goals
- JS-Based Goals
- Goal Basics
- Google Analytics Goals
- Social Sharing
- Dynamic Goals
- Typeform Integration
-
Target Visitors
- Geolocation
- Interaction Goals
- Goal-Based Targeting
- Weather Targeting
- Cookie-Based Targeting
- Page Visits
- Audience Management
- Audience Segmentation
- Experiment Targeting
- Advanced Audience Creation
- Audience Templates
- Audience Creation
- Data Layer Integration
- Manual Activation
- JavaScript Conditions
- Device Targeting
- Language Targeting
- IP-Based Exclusion
- Visitor Management
- Page Tagging
- Cookies
-
Troubleshooting
- Google Warnings
- Visual Editor
- HTTPS Content
- Logs
- Support Options
- Bootstrap
- Cookie Blocking
- Change History
- Mobile Debugging
- AdWords
- Bot Exclusion
- Domain Issues
- Cloudflare Issues
- Monitoring
- Cloaking Penalties
- Goal Editor Issues
- Variations
- Snippet Performance
- Changes Not Saved
- Blocked Visual Editor
- Goal Testing
- Visual Editor Browsing
- Experiment Issues
- Installation Verification
- Data Leak Prevention
- Usage Limits
- Experiment Previews
- GA4 Revenue
- Chrome Debugger Logs
- SPA Errors
- Checkout JSON Error
-
Analyze Results
-
Integrations
- Google Analytics
- Cookie Consent Platforms
- Microsoft Clarity
- Plausible
- Marketo
- HubSpot
- Tealium
- Smartlook
- Klaviyo
- Salesforce CRM
- FullStory
- Snowplow Analytics
- Webflow
- GA4 Roles
- Amplitude
- Segment
- React
- BigCommerce
- WooCommerce
- Active Campaign
- Google Tag Manager
- Mixpanel
- Zapier
- Inspectlet
- Crazy Egg
- LanderApp
- Unbounce
- Instapage
- Drupal
- PrestaShop
- Magento
- Roistat
- Piano Analytics
- Heap Analytics
- Kissmetrics
- Mouseflow
- Adobe Analytics
- Clicky
-
Account Management
-
Developers
-
What's New
-
Common Questions
-
Shopify
Single Page Application (SPA) Troubleshooting Guide
THIS ARTICLE WILL HELP YOU:
- Overview
- Test changes appearing on the first-page view but not on subsequent ones.
- Changes appearing on Visual Editor do not appear when previewing them outside it.
- Changes keep appearing on subsequent 'views'.
Overview
Several issues are common when trying to launch Convert experiences on Sigle Page Application (SPA) frameworks. SPA frameworks examples are React, Angular, and Vue. There are many others. However, their main common characteristic is that they do not reload when a new page or view is displayed on the browser. These frameworks only redraw the component or module that changes in the new view.
Test changes appearing on the first-page view but not on subsequent ones.
You will find that if the change that you are aiming to display only shows in the first page that you load on your browser, but not on subsequent views, then it is because the part of the Convert script that evaluates the experiments and activates them, does not run when accessing a new view or "page" of the site.
For this, you will need to fire the polling each time a new 'view' is displayed on the page. The polling is the part of the Convert script that evaluates the experience conditions, goals, segments and deploys experience code when the visitor matches them.
For this, we recommend that you install the javascript code contained in the SPA article.
Changes appearing on Visual Editor do not appear when previewing them outside it.
You create the changes on the Visual Editor, and then when you try to preview them outside the editor, these do not appear.
Must SPA frameworks do not use as Convert the DOM API to deploy changes because of performance reasons. Most of them use their own methods to deploy the changes on the page. This causes that the DOM gets out of sync when updated by the SPA. This is common in React and Angular. This causes the CSS selectors found on the Jquery code not to work.
The solution is to replace the selectors created automatically by Convert with manually created ones that are as short as possible. Maybe creating these selectors to depend on a unique id or classes that identify the element targeted without a long document path. Example: #id, .class1.class2.class3.
Changes keep appearing on subsequent 'views'.
An experiment change displays in the correct (page) view. However, when visiting new (pages) views, the change remains and does not go away.
This is caused because the changes are removed when reloading a new page on a normal site, but in a SPA site, changes are not removed.
The Convert script removes code added when the experiment conditions do not match the subsequent view where the changes were deployed when the polling is called. However, this is not sufficient as jquery changes will not disappear even if removing the experiment code of the page. You will need to execute code that undoes the changes brought by the experiment.
You could use the following code in your Project Configuration > Global Javascript section, targeting all the pages of the site.
// Condition makes code to not execute on the experience view
// or on other pages after visited afterwards.
if ((!convert.historicalData.experiments[100124225]) || convert.historicalData.experiments[100124225]) {
// undo css jquery code
// This is an example of the experiment undo code
convert.$('#Hello').css('display','block');
}