- Help Center
- Configuration
- Code Installation
-
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
How to Install the Main Tag / Convert Tracking Code / JavaScript
THIS ARTICLE WILL HELP YOU:
Where to Install the main Convert Tracking Code
The main Convert tracking code needs to be installed in the <head> section of the page, before any other loaded resource. Placing it after the <title> tag is best.
It’s not an absolute requirement to install the code just after the <title> tag, but doing it this way ensures the best performance. The reason for this is that the Convert Experiments tracking request needs to be initiated as soon as possible on the page, giving it time to get the results back before the whole page finishes loading.
Convert experiments can run even if the code is installed on the footer of the web page. However, in that case, since the tracking request will be started just before the page has loaded, the variation changes arrive later in the browser. Therefore, there will be a greater amount of time to wait before the variation is visible. This can cause a distracting visual blink of the original page before the variation is seen.
Where to Find your Convert Tracking Code
The main tracking code can be found on the Project Configuration. To find it, select your Project from the Project Panel:
Once you have selected your Project, on the top tabs select Configuration. Go to Environments & Tracking Code, select the environment you need the tracking code for and click on the meetball menu. Click on "Install Code Snippet, you will then find the tracking code snippet.
Copy and paste the code and place it on your website as described in the previous section.
Basic or Advanced Snippet?
You should install the Basic Snippet, unless you are going to use Page Tags data to target, track, or segment in Convert. Page Tags are used to transferring data from your backend being your CMS, CRM, Ecommerce Engine to Convert, or any other system that may provide your data to be used within Convert.
The Tracking Script vs Legacy Tracking Script
The new tracking script is for customers who intend to try the improved speed experience.
- The new tracking code is better due to the following reasons:
- It is independent of jQuery
- It natively supports SPA(single-page applications)
- Better experiments rendering as it does not poll but relies on modern browser API mutation observer
- Smaller footprint (about 20%)
- This script now has 2 options to block convert from running
- Pushing to queue using JavaScript with: window.conv_q.push({ what: 'disable' })
- Calling method: convert.disable()
Note: The old projects and experiments will continue to use the Legacy Tracking Script. However newer features wont be available if you continue to use the legacy sciript.
Adding the query parameter: convert_disable=true
Other Tech Changes in the Tracking Script as opposed to the Legacy Tracking script
- It's not required anymore to call the run method at first component mount of SPAs, now we detect force changes on component hydration.
- The shape of convert.data has been changed to match the new API specs at https://api.convert.com/doc/serving/
- The shape of convert.currentData has been changed in case exiting JS code relies on it:
- convert.currentData.experiments > convert.currentData.experiences : and for each Experience:
- first_time > firstTime
- variation_id > use nested id in variation property
- variation_name > use the nested name in variation property
- variation_name_parts > use variation property
- convert.currentData.experiments_goals > convert.currentData.experiencesGoals
- convert.currentData.experiments > convert.currentData.experiences : and for each Experience:
- Some API methods have been renamed:
- triggerExperimentVariation > triggerExperienceVariation
- executeMissingDataExperiments > executeMissingDataExperiences
- checkExperiments > checkExperiences
- executeExperiment > executeExperience
- executeExperimentLooped > executeExperienceLooped
- All of the above exposed API methods must be pushed into Convert Queue _conv_q
- There's one new API method that can be called directly or pushed into the queue:
- convert.ready or _conv_q.push({ what: 'ready' }) > when rendering complete (returns a promise).
- Variation Custom JS is now invoked only once per session.
Improved variation deciding logic (now matching our JS SDK).
keywords: install convert implement implementation