Free tool by MD Niamul

Free Product Schema & Add to Cart Script Generator From One Product Page Link

Get the Product Schema and a Working view_item and add_to_cart Script for That Page

No login needed
Works from a link or pasted HTML
Free Excel report

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.

30+Page and schema checks
8Shop platforms recognised
850+Projects delivered
600+Five-star reviews
MD Niamul, creator of the free product schema & add to cart script generator
upworkTop Rated Plus
GA4 Ecommerce + SchemaProduct Page Script Maker
OfficialStape Partner

Everything the Product Script Generator Reads and Writes

view_item Script
add_to_cart Script
Product Schema
ProductGroup Variants
Shopify
WooCommerce
Custom Shops
Variant at Click Time
Quantity at Click Time
Add to Cart Button Finder
Double Tracking Check
Price Mismatch Check
GTM Custom HTML
gtag Events
Meta Pixel Events
TikTok Pixel Events
Console Test Snippet
Excel Export
FREE PRODUCT PAGE TOOL

Turn One Product Page Into Schema and a Tracking Script

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.

Product Schema & Add to Cart Script Generatorview_item · add_to_cart · Product JSON-LD · GTM
Free · No login

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.

A made-up tea shop on a .example address, so you can see every tab first.
The page will not load, or it is built with JavaScript? Paste the page HTML instead

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.

Reads the product, variants and buttonSchema and script you can edit liveExcel report to download or email
WHAT IT DOES

What Does the Product Script Generator Read and Write?

It reads one product page, then writes the schema and the tracking code for that page.

Reads the Product

Name, SKU, product ID, brand, category, price, currency, image and stock status, each with the place it was found.

Reads the Variants

Shopify variants, WooCommerce variations and schema variants, with their own IDs, SKUs and prices.

Finds the Add to Cart Button

Known platform buttons and any button that says Add to cart, Add to bag, Add to basket or Buy now.

Writes the GTM Script

One Custom HTML tag in plain ES5 that pushes view_item and add_to_cart in GA4’s ecommerce format.

Reads the Choice at Click Time

The script reads the selected variant, the price and the quantity at the moment of the click, not when the page loaded.

Writes the Product Schema

Product JSON-LD, or ProductGroup with every variant, built from the page and checked against Google’s documentation.

Warns About Double Tracking

Finds view_item, add_to_cart, ViewContent and AddToCart code that is already written in the page.

Shows How to Test

GTM triggers, variables and tag settings, plus a console snippet that prints what the script would send.

How Does the Generator Work?

Three steps. No account and nothing to install.

01

Enter a product page

Paste the address of one product page. If the site blocks the request, paste the page HTML instead.

02

Check what was found

The tool shows the product, the variants, the button and the existing schema. Correct anything that is wrong.

03

Copy and test

Copy the schema and the GTM script, follow the setup steps, and test with the console snippet and GTM Preview.

What Is an Add to Cart dataLayer Script?

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.

Why must the script read the variant at the click?

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.

  • Shopify: it reads the selected variant ID from the product form and looks the variant up in the list Shopify prints in the page.
  • WooCommerce: it reads variation_id from the cart form and looks it up in the variations data on the form.
  • Other shops: it reads the selectors you confirm, then the page’s Product schema, then the values you typed.

Is a click on Add to cart the same as an add to cart?

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.

What does Google need in Product schema?

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.

What this tool cannot check

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.

GA4 Product Events at a Glance

The fields this script sends, and where it reads each one.

FieldWhat it meansWhere the script reads it
eventview_item or add_to_cartFixed by the script
ecommerce.currencyThree-letter currency codePlatform data, then the page’s schema, then product:price:currency
ecommerce.valuePrice multiplied by quantityCalculated at the moment of the event
items[].item_idSKU, product ID or variant IDYour choice. Use the ID your product feed uses
items[].item_nameProduct namePlatform data, then schema, then the page heading
items[].item_brandBrandShopify vendor or the schema brand
items[].item_categoryCategoryShopify product type, WooCommerce category or schema
items[].item_variantThe chosen size, colour or packThe variant picker, at the click
items[].pricePrice of one unitVariant data, then the visible price
items[].quantityHow many were addedThe quantity field, at the click
cart_confirmedtrue when the cart confirmed the addShopify /cart/add answer or WooCommerce added_to_cart

Who Is This Generator For?

Shop owners

Get product tracking and schema for a page without writing code from scratch.

Tracking specialists

Start from a script that already matches the platform, then adjust the selectors.

Developers

Copy clean ES5 that reads the variant, price and quantity at click time.

SEO specialists

See what Product schema a page has, what is missing, and a corrected version.

MORE FREE TOOLS

More Free Marketing Tools by MD Niamul

33 free tools for tracking, analytics, advertising and SEO. No login needed.

Free UTM Builder

Create clean UTM links with platform presets, GA4 channel preview and bulk export.

Open the UTM builder →

Free dataLayer Generator

Build ready-to-paste dataLayer code for GA4 ecommerce and lead events.

Open the dataLayer generator →

Free Measurement Plan Generator

Get a tracking plan for your business type: events, parameters and platform mapping in Excel.

Open the plan generator →

Free GA4 Event Checker

Validate GA4 event names and parameters against Google’s rules before you publish.

Open the GA4 event checker →

Trusted by 600+ Brands & Agencies

MYLENE
HOVER BOARDS
GT SOLI
CAMBRIDGE
BIENEN CORB 24
ZULU SHACK CREATIVE
ADPSY LLC
HIGH PERFORMANCE MEDIA
ADS PERFORMANCE
LEGESI
TESTIMONIAL

Analytics & Conversion Tracking Client Testimonials

Hear from our clients. Loved by 600+ businesses worldwide.

Madison Jonas, client of MD Niamul
Madison JonasGoogle Ads clientLinkedIn recommendation
★★★★★

“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.”

Mehboob Khan, client of MD Niamul
Mehboob KhanGoogle Analytics projectsLinkedIn recommendation
★★★★★

“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.”

Jacco Bouw, client of MD Niamul
Jacco BouwShopify, GA4 & Google Ads trackingLinkedIn recommendation
★★★★★

“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.”

Ryan S Kemp, client of MD Niamul
Ryan S KempCMO, Co-Founder, Zulu Shack CreativeLinkedIn recommendation
★★★★★

“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.”

Casper Klein, client of MD Niamul
Casper KleinMeta Pixel & server-side trackingLinkedIn recommendation
★★★★★

“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.”

600+

Five-star reviews from businesses and agencies in the USA, Canada, UK and Australia.

Read All Reviews

Video Testimonials: Hear It From Our Clients

FAQ

Frequently Asked Questions About the Free Product Schema & Add to Cart Script Generator

Is the product script generator free?

Yes. It is free with no login. You can copy every block of code, download the Excel report, or have the report emailed to you.

How do I track add to cart in Google Tag Manager?

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.

What is the difference between the dynamic and the static script?

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.

Does the script work for products with variants?

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.

Will this double my events if I already have tracking?

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.

My page already has Product schema. Should I add this one too?

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.

Why are some values missing?

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.

Does it track purchases too?

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.

Can I use the script without Google Tag Manager?

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.

Track Every Product View and Add to Cart the Right Way

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.