On-Load Tracking
Overview
The On-Load Publisher Tag automatically detects and enhances existing CJ tracking links on your web pages. This solution transforms static affiliate links into dynamic, trackable interactions using CJ's bounceless technology without requiring individual link modifications.
Key Benefit: Automatically upgrades all CJ tracking links on your site to use advanced bounceless tracking technology, eliminating redirect delays while maintaining full click attribution.
When to Use On-Load Tracking
Choose On-Load tracking when your website:
- Contains embedded CJ tracking links within content (blog posts, articles, reviews)
- Features multiple affiliate links across various pages
- Requires automatic link enhancement without manual code changes per link
- Needs to maintain existing link structure while improving tracking performance
- Uses content management systems where individual link modification is impractical
Ideal for: Content publishers, bloggers, review sites, affiliate marketing websites, and promotional properties with embedded tracking links.
Prerequisites
Before implementing On-Load tracking, ensure you have:
- Active CJ Publisher account with appropriate permissions
- Access to your website's HTML
<head>section or header management - Existing CJ tracking links present on your web pages
- Ability to add JavaScript code site-wide
- Understanding of your platform's header modification process
Important for EU/UK PublishersTo comply with GDPR and ePrivacy regulations, bounceless tracking functionality requires a user consent signal for non-loyalty traffic. The On-Load tag does not automatically add this signal. You must ensure that your existing CJ links have the
cjgdprandcjgdprTypeparameters appended before this tag can enable bounceless journeys for your EU/UK users. Please contact the Support team for implementation details.
Implementation Steps
Step 1: Generate Your On-Load Publisher Tag
- Log into your CJ Publisher account
- Navigate to Account > TRACKING > Publisher Tags
- Create a new On-Load tag type
- Copy the generated HTML
<script>element - Record your tag details for reference
Note: The generated tag contains your unique Publisher CID and Tag ID. Keep this information secure and do not share publicly.
Step 2: Implement the Publisher Tag
Add the Publisher Tag script to the <head> section of all pages on your website. The tag must be placed before the closing </head> tag.
<!-- BEGIN CJ ON-LOAD PUBLISHER TAG -->
<script type="text/javascript" src="https://www.p.zjptg.com/tag/{PUBLISHER_CID}/{TAG_ID}/"></script>
<!-- END CJ ON-LOAD PUBLISHER TAG -->Critical: Replace the example above with your actual generated tag from Step 1.
Step 3: How the On-Load Tag Works
The script uses DOM manipulation to inject event listeners and modify href attributes, creating a hybrid approach that maintains SEO benefits while enabling JavaScript-based tracking.
Once installed, the tag automatically:
- Scans pages for existing CJ tracking links during page load
- Modifies detected links to include the new JavaScript function:
onclick="event.preventDefault(); cj.navigate(...)" - Intercepts clicks on modified links to trigger bounceless tracking
- Records click data before redirecting users to the advertiser site
- Maintains user experience with seamless navigation
Platform-Specific Implementation
Important: Platform interfaces may change over time. If these instructions don't match your current platform, use the general implementation method above and contact your platform's support team for header modification assistance.
Blogger
- Log into your Blogger dashboard
- Select Layout from the left sidebar
- Click Add a Gadget
- Choose HTML/JavaScript from the gadget list
- In the configuration popup:
- Paste your CJ Publisher Tag in the Content area
- Ensure Show this widget is toggled ON
- Click Save
- Drag the new HTML/JavaScript gadget to the Header section
- Click the Save icon (floppy disk symbol)
Google Tag Manager
- Verify your website is properly integrated with GTM
- Access your GTM account and select your workspace
- Navigate to the Tags section
- Click New to create a new tag
- In Tag Configuration:
- Select Custom HTML
- Paste your CJ Publisher Tag in the HTML field
- In Triggering:
- Select All Pages trigger
- Name your tag (example: "CJ Publisher Tag – On Load")
- Click Save
- Click Submit then Publish to make changes live
Squarespace
- Log into Squarespace and open your desired site
- Navigate to Settings
- Select Advanced
- Click Code Injection
- In the Header section, paste your CJ Publisher Tag
- Click Save at the top of the page
WordPress
If using the Insert Headers and Footers plugin:
- Access your WordPress dashboard
- Go to Settings > Insert Headers and Footers
- In the Scripts in Header section, paste your CJ Publisher Tag
- Scroll down and click Save
Alternative method for theme customization:
- Access Appearance > Theme Editor
- Select header.php
- Locate the
</head>tag - Insert your CJ Publisher Tag before the closing
</head>tag - Click Update File
Testing and Validation
Pre-Testing Checklist
- Publisher Tag installed in website header
- Tag present on pages containing CJ tracking links
- Browser Developer Tools accessible
- Test pages with CJ links identified
Step-by-Step Validation Process
1. Verify Tag Loading
- Open your browser Developer Tools (Chrome:
Ctrl+Shift+I, Mac:Cmd+Option+I) - Navigate to the Network tab and start recording
- Load a page on your website
- Confirm your Tag ID appears in Network logs with 200 status code
2. Confirm Link Modification
- Navigate to a page containing CJ tracking links
- Wait for complete page load
- Right-click on a CJ tracking link
- Select Inspect or Inspect Element
- Verify the link now includes:
onclick="event.preventDefault(); cj.navigate(...)"
3. Test Click Tracking
- With Developer Tools open and Network tab recording
- Click a modified CJ tracking link
- Confirm Network logs display a V1 entry with 200 status code
- Verify successful navigation to the advertiser website
Success Indicators
- ✅ Tag Loading: CJ script loads without errors
- ✅ Link Detection: Existing CJ links gain new onclick attributes
- ✅ Click Tracking: V1 network requests fire on link clicks
- ✅ User Navigation: Seamless redirection to advertiser sites
- ✅ Performance: No noticeable delay in page loading or navigation
Troubleshooting Common Issues
| Issue | Symptom | Solution |
|---|---|---|
| Tag not loading | No Tag ID in Network logs | Verify tag placement in <head> section, check CID/TAG_ID values |
| Links not modified | Missing onclick attributes | Ensure CJ links are properly formatted, check for JavaScript errors |
| Click tracking fails | No V1 network request | Verify link modification successful, check console for errors |
| Navigation issues | User doesn't reach advertiser | Test links directly, verify advertiser site accessibility |
| Performance impact | Slow page loading | Ensure tag is in <head>, not multiple times on same page |
Advanced Configuration
Multiple Domain Implementation
For publishers managing multiple domains:
- Generate separate Publisher Tags for each domain
- Install domain-specific tags on respective properties
- Monitor performance across all implementations
- Maintain consistent testing procedures for each domain
Performance Monitoring
Key Metrics to Track
- Click-through rates on affiliate links
- Conversion attribution accuracy
- Page load performance impact
- User experience metrics
- Revenue tracking consistency
Optimization Tips
- Minimize tag conflicts: Avoid duplicate tracking implementations
- Regular validation: Test functionality after site updates
- Performance monitoring: Watch for any negative page speed impact
- Link quality: Maintain current, functional CJ tracking links
Technical Support
If validation tests fail or integration issues occur:
- Double-check implementation against provided instructions
- Review browser console for JavaScript errors
- Verify network requests show proper CJ tracking calls
- Document specific errors with screenshots if possible
- Contact CJ Support through your Account Support Center with detailed error information
Next Steps
After successful implementation:
- Monitor dashboard metrics for tracking accuracy improvements
- Review click attribution in your CJ reporting
- Stay updated on CJ platform enhancements and new features
Updated 3 months ago
