⚠️ Important for WooCommerce Stores
If you are setting up the Cometly Pixel for your WooCommerce store, do not proceed with manual installation. Instead, visit our WooCommerce Integration Guide for the correct setup. The Cometly Pixel is automatically installed through our WooCommerce plugin, ensuring proper tracking without additional steps.
Installing the Cometly Pixel on WordPress
Add Cometly Pixel Script
Install the Cometly Pixel base code in the <head>
section of your WordPress site.
This can typically be done using a header script manager plugin or by editing your theme’s header file.
Ensure Proper Functionality
After adding the base code, make sure to:
Clear Your Cache: This ensures that the new changes take effect.
Adjust JavaScript Settings in Plugins: Adjust the settings of any plugins that defer or lazy-load JavaScript. Ensure that options for deferring or implementing lazy-loading of JavaScript are disabled to prevent interference with the Cometly Pixel.
Test Pixel Installation: Use our Install & Verify Cometly Pixel article for step-by-step instructions and a video tutorial to confirm the pixel is loading properly.
Check Site Performance & Caching Plugins
WordPress offers a wide range of plugins for managing headers, performance, and caching. Be aware that plugins like WP Rocket, Autoptimize, or similar tools may require adjustments to ensure the Cometly Pixel works correctly.
Configuring Settings In WP Rocket
If you use WP Rocket, you need to navigate to your WP Rocket settings to ensure you have unchecked specific settings.
Go to your WordPress dashboard and select Settings > WP Rocket.
Open the File Optimization tab.
Scroll down to the JavaScript Files section and ensure the following options are unchecked:
Combine JavaScript files
Load JavaScript deferred
Delay JavaScript execution
Save Changes
After making these adjustments, save your settings and clear your cache.
By following these steps, you can successfully set up the Cometly Pixel on your WordPress site and ensure accurate tracking. If you use other performance or header management plugins, consult their documentation for similar configuration steps to avoid interfering with JavaScript loading.