Description
The Camco Travel Toilet Replacement Lid and Seat is a replacement part for Camco Travel Toilets 41535, 41544, and 41545. Travel toilets are perfect for camping, hunting and other remote activities. The replacement lid and seat are elongated in shape for additional comfort. It has a smooth finish for easy cleaning. Lid and seat are made of durable ABS.
Extra Information
document.addEventListener('DOMContentLoaded', function() {
// Select the element containing the price
const priceElement = document.querySelector('.price--withoutTax');
// Check if the price element exists and log it for debugging
if (priceElement) {
console.log('Price Element:', priceElement.textContent.trim()); // Log the entire text content of the price element
// Strip the non-numeric characters (e.g., "$", "Your Price: ", etc.)
const priceText = priceElement.textContent.trim().replace(/[^\d.-]/g, '');
const numericPrice = parseFloat(priceText); // Convert the price to a float
console.log('Formatted Numeric Price:', numericPrice); // Log the extracted numeric price
if (numericPrice && !isNaN(numericPrice)) {
console.log('Sending GA4 event with price:', numericPrice); // Log before sending GA4 event
// Proceed with sending the event to GA4 if the price is valid
gtag('event', 'view_item', {
"currency": "USD", // Ensure this is correct for your currency
"value": numericPrice, // Pass the price as a float
"items": [{
"id": "4017", // Use the actual product ID here
"name": "Camco Rhino Ultimate 20' RV Sewer Hose Kit", // Replace with the actual product name
"category": "RVing & Camping, RV Sanitation", // Replace with the actual category
"brand": "Rhino", // Replace with the actual brand
"variant": "single-product-option", // Replace with the actual variant
"price": numericPrice // Include price in the event data
}]
});
} else {
console.error('Invalid price:', numericPrice); // Log if the price is invalid
}
} else {
console.error('Price element not found.'); // Log if the price element is not found
}
});