Google Ads · Track a conversionStep 1 of 3

Track AddToCart

The AddToCart event fires when a visitor clicks the Add to Cart button on a product page. Google Ads uses it as an upper-funnel signal for Smart Bidding and as a seed for retargeting audiences.

1. Create the AddToCart conversion action in Google Ads

Before AdsPing can forward an AddToCart to Google Ads, the conversion action has to exist on the Google Ads side. We’ll create one now.

Skip this section if you already have an AddToCart conversion action set up that uses the website data source — jump to step 2.

  1. 1.1 — Sign in to ads.google.com

    Open ads.google.com with the Google account that has Admin or Standard access.

  2. 1.2 — Open the Conversions page

    Left navigation → Goals (Hedefler) → Conversions (Dönüşümler) → Summary (Özet). Or on classic UI: top-right Tools gear → Conversions.

  3. 1.3 — Click “+ New conversion action”

    The blue + New conversion action (“+ Yeni dönüşüm işlemi”) button.

  4. 1.4 — Pick “Website” as the data sourceMost important step

    Google shows a list of data sources. Pick Website (“Web sitesi”): the source for conversions that happen on the merchant’s own site. This is the only source AdsPing forwards to.

    ✓ Pick this one

    Website — Web sitesi

    ✗ Do NOT pick any of these

    • Phone calls — Google’s call infrastructure.
    • App — mobile SDK, not a website button click.
    • Import / Offline / Salesforce — manual upload, not a real-time site event.
    • GA4 — different destination.

    Click Save and continue.

  5. 1.5 — Pick the conversion category: Add to cart (Alışveriş sepetine ekleme)

    On the “Group your conversions” screen, pick the cart-specific card:

    Alışveriş sepetine ekleme — Add to cart

    “Bir kullanıcının alışveriş sepetine ürün eklemesidir.”

    In English Google Ads UI: Add to cart.

    Click Save and continue.

  6. 1.6 — Recommended settings on the details page

    • · Conversion name: “Add to cart — [your store]”.
    • · Value: Use different values for each conversion — AdsPing will send the product price. Helps Smart Bidding prioritize cart-adds of higher-value items.
    • · Count: Every — a visitor adding 3 different products to cart should count as 3 conversions for an upper-funnel signal like this.
    • · Click-through window: 30 days (default).
    • · Attribution model: Data-driven.
    • · Include in “Conversions”: No (upper-funnel signal — keep it as a secondary conversion). Set to Yes only if you want Smart Bidding to optimize toward AddToCart rather than Purchase. For most e-commerce, optimize toward Purchase and keep AddToCart as observational.

    Click Done, then Save and continue.

  7. 1.7 — Skip the tag-setup screen

    You don’t need to install Google’s tag — AdsPing fires the equivalent. Click Done and exit the wizard.

  8. 1.8 — Copy the Conversion Action ID

    Click your new AddToCart action and copy the number after ctId= in the URL bar:

    https://ads.google.com/aw/conversions/customers/3884688380/detail?ctId=987654321

2. Wire the action in AdsPing

  1. 2.1 — Open your pixel → Destinations tab → Add action on the Google Ads card.
  2. 2.2 — Fill the form:
    • Name: “Add to cart — [your store]”
    • Customer: pre-filled.
    • Conversion action: pick the AddToCart action you created in step 1.
    • Event name filter: AddToCart
  3. 2.3 — Save. See wizard Step 3 for screenshots.

3. Find your Add-to-Cart button selector

Open a product page, right-click your Add to Cart button → Inspect. Note its id (e.g. add-to-cart-button) or a unique class (e.g. .btn-add-to-cart).

If the button has no id, add one. Or replace #add-to-cart-button in the snippet below with .your-button-class (using a dot prefix for class).

4. Copy the snippet

Replace the example product info with template values that render the real product’s name, SKU, and price.

Option A — pbq (recommended)

product-page.html
<!-- Place inside the <body> of your product detail page,
     AFTER the AdsPing script in <head>. -->
<script>
  document.querySelector('#add-to-cart-button')
    .addEventListener('click', function () {
      pbq('track', 'AddToCart', {
        content_name: 'Acme Hydrating Serum',
        content_ids: ['SKU-1043'],
        content_type: 'product',
        value: 24.90,
        currency: 'USD'
      });
    });
</script>

Option B — dataLayer

product-page.html
<!-- Place inside the <body> of your product detail page,
     AFTER the AdsPing script in <head>. -->
<script>
  document.querySelector('#add-to-cart-button')
    .addEventListener('click', function () {
      window.dataLayer = window.dataLayer || [];
      window.dataLayer.push({
        event: 'add_to_cart',
        ecommerce: {
          value: 24.90,
          currency: 'USD',
          items: [
            { item_id: 'SKU-1043', item_name: 'Acme Hydrating Serum' }
          ]
        }
      });
    });
</script>

5. Where to paste the snippet

Paste it inside the <body> of your product detail page template, near the bottom — so the button element exists in the DOM by the time the script attaches the click listener.

6. Test it

Open a product page, click Add to Cart, then switch to your AdsPing dashboard. An AddToCart row appears in Recent Events within 10 seconds with a green Success badge.

✓ AddToCart is live.

Google Ads will start picking up cart additions as an upper-funnel signal for conversion optimization and retargeting audiences.