Get the Product Schema and a Working view_item and add_to_cart Script for That Page
Paste the link of a product page. This tool reads the page and writes an add to cart dataLayer script for it: a Google Tag Manager tag that sends GA4 view_item when the page loads and add_to_cart with the variant, price and quantity the visitor chose. It is also a product schema generator from a URL: you get the Product or ProductGroup JSON-LD for the same page, checked against Google’s required and recommended properties.
Enter the address of one product page on your website. You get the Product schema, the GTM script and the setup steps for that page.
The address you enter is sent to our server, which loads the page once to read its public code. Pasted HTML is read in your browser and is not uploaded. We keep a simple log of the page address, the platform found and the product name. No personal details are saved unless you ask for the report by email.
Open the product page in your browser. Right-click, choose “View page source”, select all and copy. For a page that JavaScript draws, open the developer tools instead, right-click the <html> element and choose Copy, then Copy outerHTML. Keep the page address in the box above so the links in the schema are right.
Get the Excel report with what was found, the checks, and all the generated code.
I set up GA4 ecommerce tracking, server-side tagging and conversion tracking for online shops, from view_item to purchase, and test every event.
It reads one product page, then writes the schema and the tracking code for that page.
Name, SKU, product ID, brand, category, price, currency, image and stock status, each with the place it was found.
Shopify variants, WooCommerce variations and schema variants, with their own IDs, SKUs and prices.
Known platform buttons and any button that says Add to cart, Add to bag, Add to basket or Buy now.
One Custom HTML tag in plain ES5 that pushes view_item and add_to_cart in GA4’s ecommerce format.
The script reads the selected variant, the price and the quantity at the moment of the click, not when the page loaded.
Product JSON-LD, or ProductGroup with every variant, built from the page and checked against Google’s documentation.
Finds view_item, add_to_cart, ViewContent and AddToCart code that is already written in the page.
GTM triggers, variables and tag settings, plus a console snippet that prints what the script would send.
Three steps. No account and nothing to install.
Paste the address of one product page. If the site blocks the request, paste the page HTML instead.
The tool shows the product, the variants, the button and the existing schema. Correct anything that is wrong.
Copy the schema and the GTM script, follow the setup steps, and test with the console snippet and GTM Preview.
Google Analytics 4 does not know what a product page is. It learns it from two events. view_item says “a visitor looked at this product”. add_to_cart says “a visitor put this product in the cart”. Both carry an ecommerce object with the currency, the value and an items list holding the item_id, item_name, item_brand, item_category, item_variant, price and quantity.
An add to cart dataLayer script is the small piece of JavaScript that pushes those events into the dataLayer, where Google Tag Manager picks them up. A copied example is not enough, because it holds made-up values. The script has to read the real product on your page. That is what this tool writes: a view_item dataLayer script and an add to cart listener that fit the page you entered.
On a product with sizes or colours, the visitor changes the choice after the page has loaded. A script that reads the product once sends the first variant and the first price every time. The script from this tool reads the variant picker, the quantity field and the price at the moment of the click.
variation_id from the cart form and looks it up in the variations data on the form.No. A click can fail: the product is out of stock, or a required option was not chosen. Where the platform offers something better, the script uses it. On Shopify it waits for the request to /cart/add to come back OK. On WooCommerce it listens for the added_to_cart event that WooCommerce fires after an add without a page reload. Each push is marked cart_confirmed: true or false, so you can see which is which. On other platforms the script tracks the click, and the page says so.
Google’s documentation describes two levels. A product snippet needs the name plus at least one of offers, review or aggregateRating. A merchant listing, which unlocks the shopping features, also needs an image and an Offer with a price above zero and a priceCurrency. Availability, description, brand, SKU and GTIN are recommended. A price range (AggregateOffer) is accepted for product snippets only. For products with variants, Google documents ProductGroup with hasVariant, variesBy and productGroupID. Check Google’s Product structured data pages for the current rules.
The tool reads the page source as a server receives it. Values that JavaScript adds after the page loads may be missing. Paste the rendered HTML to cover that. The selectors are best guesses from the page source and must be tested on your site before you publish. It sees only tracking code written in the page itself, so tags inside GTM, inside apps or in external script files are invisible to it. A tracked click on Add to cart is not proof that the cart accepted the product. Checkout and purchase tracking are not covered. Schema must describe what visitors can see on the page, and valid schema makes a page eligible for rich results without guaranteeing them. The tool does not run your page, so it cannot promise the script works on every theme.
The fields this script sends, and where it reads each one.
| Field | What it means | Where the script reads it |
|---|---|---|
| event | view_item or add_to_cart | Fixed by the script |
| ecommerce.currency | Three-letter currency code | Platform data, then the page’s schema, then product:price:currency |
| ecommerce.value | Price multiplied by quantity | Calculated at the moment of the event |
| items[].item_id | SKU, product ID or variant ID | Your choice. Use the ID your product feed uses |
| items[].item_name | Product name | Platform data, then schema, then the page heading |
| items[].item_brand | Brand | Shopify vendor or the schema brand |
| items[].item_category | Category | Shopify product type, WooCommerce category or schema |
| items[].item_variant | The chosen size, colour or pack | The variant picker, at the click |
| items[].price | Price of one unit | Variant data, then the visible price |
| items[].quantity | How many were added | The quantity field, at the click |
| cart_confirmed | true when the cart confirmed the add | Shopify /cart/add answer or WooCommerce added_to_cart |
Get product tracking and schema for a page without writing code from scratch.
Start from a script that already matches the platform, then adjust the selectors.
Copy clean ES5 that reads the variant, price and quantity at click time.
See what Product schema a page has, what is missing, and a corrected version.
33 free tools for tracking, analytics, advertising and SEO. No login needed.
Create clean UTM links with platform presets, GA4 channel preview and bulk export.
Open the UTM builder →Build ready-to-paste dataLayer code for GA4 ecommerce and lead events.
Open the dataLayer generator →Get a tracking plan for your business type: events, parameters and platform mapping in Excel.
Open the plan generator →Validate GA4 event names and parameters against Google’s rules before you publish.
Open the GA4 event checker →Hear from our clients. Loved by 600+ businesses worldwide.
“I had an excellent experience working with MD on my Google Ads account. Everything was set up perfectly and worked smoothly without any issues or troubleshooting needed. His expertise and attention to detail made the whole process effortless.”
“I worked with Niamul on multiple Google Analytics projects and was impressed by his expertise and precision. He has a strong grasp of tracking, reporting, and optimization, always ensuring accurate insights. He is proactive, reliable, and easy to collaborate with.”
“MD Niamul is extremely skilled. He fixed my Shopify, Google Analytics, and Google Ads conversion tracking perfectly. Everything works exactly as it should now, and he even added an extra data layer, which was very helpful. Outstanding service, fast delivery, and highly recommended.”
“Reliable, knowledgeable, and truly trustworthy. I’ve been working with Niamul for over a year, and he consistently delivers exceptional results across all analytics tasks. His expertise, communication, and commitment make him my go-to specialist for tracking, measurement, and data accuracy.”
“MD N delivered flawless Meta Pixel, CAPI, and server-side tracking. He understood our goals quickly, explained everything clearly, and ensured full transparency. Communication was smooth, updates were consistent, and the results improved our data accuracy and ad performance.”
Five-star reviews from businesses and agencies in the USA, Canada, UK and Australia.
Read All ReviewsYes. It is free with no login. You can copy every block of code, download the Excel report, or have the report emailed to you.
Add the generated script as a Custom HTML tag that fires on DOM Ready on your product pages. Create a Custom Event trigger for view_item and add_to_cart, then a GA4 Event tag with “Send Ecommerce data” switched on. The GTM setup tab lists each step.
The dynamic script reads the product from the page each time, so one tag works on every product page that uses the same template. The static script holds the values of one product and only runs on that page. Choose dynamic for a whole shop and static for a single landing page.
Yes. It reads the selected variant, its price and the quantity at the moment of the click. On Shopify and WooCommerce it uses the platform’s own variant list. On other shops you confirm the selector of the variant picker.
It can. The tool looks for view_item, add_to_cart, ViewContent and AddToCart code written in the page and warns you. It cannot see tags inside GTM, apps or external script files, so also check GTM Preview before you publish.
No. The tool tells you when schema is already there and shows an improved version. Replace the existing block, or change it in your theme or SEO plugin. Two Product blocks for one product confuse search engines.
The tool reads the page source a server receives. If your shop draws the product with JavaScript, the price or the button may not be in that source. Open “Paste the page HTML”, paste the rendered HTML from your browser, and run it again.
No. It covers the product page only: view_item and add_to_cart. Checkout and purchase tracking need access to the checkout and the order data, which this tool does not read.
The script only pushes to the dataLayer, so something must read it. Without GTM, use the plain gtag, Meta Pixel and TikTok Pixel versions in the “gtag, Meta, TikTok” tab instead.
I am MD Niamul, a conversion tracking and web analytics specialist and an official Stape partner. I set up and test GA4 ecommerce tracking and server-side tagging for online shops, so the numbers in your reports match what really happened.