Skip to content
Peekbird

Automatic events

Peekbird can notice the standard events on your site by itself: purchases, add to cart, checkouts, discount codes, errors, sign-ups and searches. They arrive as events like the ones you send, so goals and recording filters can use them, with no code.

Turn it on

In your site's Site settings, under Automatic events, switch on Detect events automatically, then choose under What to detect. Every kind is chosen the first time you turn it on; keep at least one, or turn detection off.

  • It needs Collect analytics on, in the card above it: detected events are sent with analytics.
  • It's off for new sites, except a site created by connecting a Shopify store, which starts with every kind on. The Peekbird app in your Shopify admin has an Automatic events switch too; choose the kinds in Peekbird.
  • It starts once your page has finished loading, so it never slows the page down.

What it detects

It looks in four places, the most reliable first:

  • Your data layer: what your site already tells Google Analytics 4 or Google Tag Manager (dataLayer and gtag), including what it held before Peekbird started. Older Universal Analytics ecommerce entries count too.
  • Shopify and WooCommerce: their cart and discount code requests, and their order confirmation pages.
  • Your site's requests: add-to-cart and discount code requests your pages send, on other shops too.
  • The page itself: what visitors click and send, and what the page shows them after.
KindEvents sentNoticed from
PurchasespurchaseYour data layer; Shopify's and WooCommerce's order confirmation pages; any order confirmation page that shows an order number and a total.
Add to cartadd_to_cartYour data layer; Shopify's, WooCommerce's and other shops' add-to-cart requests; an add-to-cart button, once the cart count goes up or the page says the item was added.
Checkout startedbegin_checkoutYour data layer; a checkout page (an address like /checkout); leaving through a checkout button.
Discount codescoupon_appliedcoupon_failedShopify's, WooCommerce's and other shops' discount code requests; a discount code field, and the message the page shows after it.
Errors shownerror_shownThe page: a form the browser refuses; error messages that appear after the visitor clicks, changes a field or sends a form; error messages already on a page when it loads, like your server's answer to a form. A message is marked as an error (an error class, say); an alert or red text counts when it's beside a form field or reads like an error, so a page title read out, a player's status or a price that fell isn't one.
Sign-upssign_upnewsletter_signupYour data layer (sign_up); a form with an email address, sent without an error: with a password it's a sign-up (log-ins are left out), short and without one it's a newsletter.
SearchessearchYour data layer; a search form; a results page's address, like /search?q=shoes.

Goals and filters match these names exactly. Each detected event carries detected: true, and detected purchases count toward the standard purchase goals, with their revenue.

Your own tracking comes first

  • A detected event waits 1.5 seconds before it's sent. If your site sends an event with the same name in that time, with peekbird.push(['track', …]), the detected one is left out, and that name isn't detected again for the rest of the visit in that browser tab.
  • Each order counts once, by its order ID. The browser remembers the last 50, so a reloaded thank-you page doesn't count again, and a detected order steps aside for any event with the same order ID, from your own code or the Shopify app's checkout pixel.
  • The same thing seen twice in quick succession (in the data layer and in a request, say) is sent once. Checkout started counts once a visit, and one page sends at most 20 error messages.
  • Leaving the page sends what's waiting at once.
  • Orders aside, detection is best-effort: it reads common patterns, so on a site built differently it can miss events. For the events your experiments are judged on, send them yourself.

Privacy

Detection reads only what each event needs: a search term, a discount code, a message, a product name. It never reads password, card or gift card fields.

With Mask all text on (in Recording settings, under Privacy), it sends no text at all: no search terms, discount codes, messages or product names. The events are still sent, and the setting applies even when recordings are off. One thing still goes: an error names the field it was about, by the field's name or id, or by its label's text.

Error messages inside an element with the peekbird-mask class are sent without their text, and those inside peekbird-block aren't sent (see Privacy controls). Like the rest of Peekbird, detection waits for consent where your site does: see Consent.

Checking it

Open any page of your site with ?peekbird_debug=1 added to its address. The browser console lists each event detected, and each one left out because your site sends it itself.

Sending them yourself

Your own code knows what detection has to guess: the exact total and currency of an order, why a code was refused, the events that matter to your business. Send them with the same names, and they replace the detected ones: see Purchases, Coupons, Errors shown and Other events.

See what your visitors see.

Start free in a few minutes: one snippet, every feature. Move to a bigger plan when you need more tracked visits.