Skip to main content

WooCommerce Integration

OneTap Login for WooCommerce is designed primarily for WooCommerce stores, providing seamless Google sign-in integration across all customer touchpoints.

Overview

Integration Points

OneTap Login integrates with WooCommerce in these locations:

LocationOne TapButtonPurpose
My AccountLogin/registration
Checkout (Classic)PROPROQuick checkout sign-in
Checkout (Blocks)PROPROBlock-based checkout
Cart PagePROPROSign in before checkout
Thank You PagePRO-Account linking

My Account Page

Default Integration

The My Account page (/my-account/) is the primary integration point:

┌────────────────────────────────────────┐
│ My Account │
│ │
│ Username: [________________] │
│ Password: [________________] │
│ │
│ [ Log In ] │
│ │
│ ─────── or continue with ─────── │
│ │
│ [G Continue with Google] │
│ │
│ Lost your password? │
└────────────────────────────────────────┘

One Tap Popup

One Tap appears automatically when:

  • User is not logged in
  • User has Google account in browser
  • Not in cooldown period

One Tap on My Account

Configuration

Enable in Settings > OneTap Login > General:

  • Enable One Tap: Show One Tap popup
  • Enable button on My Account: Show sign-in button

Checkout Page

Classic Checkout (PRO)

Google sign-in appears at the top of checkout:

┌────────────────────────────────────────┐
│ Checkout │
│ │
│ Returning customer? Log in │
│ │
│ ─────── or ─────── │
│ │
│ [G Sign in with Google] │
│ │
│ ───────────────────────────── │
│ │
│ Billing Details │
│ ... │
└────────────────────────────────────────┘

WooCommerce Blocks Checkout (PRO)

For stores using Block-based checkout:

Blocks Checkout Integration

The button integrates with:

  • Express checkout section
  • Login form area
  • Compatible with Checkout Blocks 8.0+

Benefits at Checkout

  1. Pre-filled information: Name, email from Google profile
  2. Faster checkout: Skip form filling
  3. Account creation: Optional during checkout
  4. Order history: Linked to account

Guest Checkout Handling

If guest checkout is enabled:

ScenarioBehavior
User signs inAccount login, checkout continues
User skipsGuest checkout proceeds
Email matchesAccount link option shown

Cart Page

Why Cart Integration? (PRO)

Sign in earlier in the journey:

  • Sync cart across devices
  • Apply member discounts
  • Personalized experience

Cart Placement

Button appears above/below cart table:

┌────────────────────────────────────────┐
│ Shopping Cart │
│ │
│ Have an account? │
│ [G Sign in with Google] │
│ │
│ ───────────────────────────── │
│ │
│ Product Qty Price │
│ ... │
└────────────────────────────────────────┘

Thank You Page Linking (PRO)

Post-Purchase Account Creation

After guest checkout, prompt account creation:

┌────────────────────────────────────────┐
│ 🎉 Thank you for your order! │
│ │
│ Order #1234 confirmed │
│ │
│ ───────────────────────────── │
│ │
│ Create an account to: │
│ ✓ Track your order │
│ ✓ Quick reorders │
│ ✓ Exclusive offers │
│ │
│ [G Continue with Google] │
│ │
│ [No thanks] │
└────────────────────────────────────────┘

Order Association

When customer creates account:

  1. Account created with Google email
  2. Current order linked to account
  3. Previous orders with same email linked
  4. Customer can view order history

WooCommerce Customer Data

Profile Information

Google sign-in provides:

WooCommerce FieldGoogle Source
EmailGoogle account email
First NameGiven name
Last NameFamily name
Display NameFull name

Billing/Shipping

Not auto-filled from Google:

  • Address fields
  • Phone number
  • Company name

These must be entered manually or from previous orders.

WooCommerce Roles

Default Customer Role

New registrations receive the Customer role:

// Default WooCommerce role for new users
$default_role = 'customer';

Role Configuration

In Settings > OneTap Login > Users:

SettingOptions
Default rolesubscriber, customer, contributor, author
Auto-registerEnable/disable new account creation

Role Restrictions

Cannot assign via Google sign-in:

  • Administrator ❌
  • Editor ❌
  • Shop Manager ❌

WooCommerce Emails

Default Behavior

Standard WooCommerce emails sent:

  • New Account email (if enabled)
  • Order Confirmation
  • Order Processing
  • etc.

Welcome Email Editor (PRO)

Customize Google user welcome email:

  • Different from standard WooCommerce email
  • Specific messaging for Google sign-ups
  • Merge tags for personalization

WooCommerce Subscriptions

Compatibility

OneTap Login works with WooCommerce Subscriptions:

  • Subscribe via Google sign-in
  • Account links correctly
  • Subscription management in My Account

Considerations

  • Ensure customer role has subscription capabilities
  • Test subscription flow with Google accounts
  • Verify renewal emails reach Google email

WooCommerce Memberships

Integration

Works with WooCommerce Memberships:

  • Sign in with Google
  • Membership auto-assigned based on purchase
  • Access controls work normally

Role Mapping (PRO)

For membership sites:

@company.com → Member
@vip.company.com → VIP Member

Mini Cart & Fragments

AJAX Cart

Google sign-in updates cart fragments:

  • Cart count updates
  • Mini cart refreshes
  • Prices reflect member status

Session Handling

Guest session → Google sign-in → Customer session
Cart preserved and transferred to logged-in user

Shortcode in WooCommerce (PRO)

Product Pages

Add button to product templates:

// In your product template or via hook
echo do_shortcode('[onetap_button]');

Custom Checkout Fields

Within custom checkout sections:

add_action('woocommerce_before_checkout_form', function() {
echo do_shortcode('[onetap_button text="signin_with" theme="filled_blue"]');
});

WooCommerce Hooks

After Google Registration

add_action('onetap_user_registered', function($user_id, $google_data) {
// Set customer billing email
update_user_meta($user_id, 'billing_email', $google_data['email']);

// Set billing name
update_user_meta($user_id, 'billing_first_name', $google_data['given_name']);
update_user_meta($user_id, 'billing_last_name', $google_data['family_name']);
}, 10, 2);

After Google Login

add_action('onetap_user_logged_in', function($user_id, $google_data) {
// Sync cart from session
if (WC()->cart) {
WC()->cart->set_session();
}

// Track for analytics
do_action('customer_google_login', $user_id);
}, 10, 2);

Before Order Completion

add_action('woocommerce_checkout_create_order', function($order, $data) {
// Check if registered via Google
$user_id = get_current_user_id();
if (get_user_meta($user_id, '_onetap_google_id', true)) {
$order->add_meta_data('_registered_via', 'google');
}
}, 10, 2);

Order Attribution (PRO)

UTM Tracking

With UTM Tracking enabled:

  • Campaign data captured
  • Stored in order meta
  • Visible in Order Analytics

Order Meta Fields

Meta KeyDescription
_onetap_utm_sourceTraffic source
_onetap_utm_mediumMarketing medium
_onetap_utm_campaignCampaign name
_onetap_gclidGoogle Ads click ID

Performance Considerations

Cart Fragments

Google sign-in respects:

  • WooCommerce cart fragment caching
  • AJAX operations
  • Page caching plugins

Sessions

  • Uses WordPress sessions for guest carts
  • Transfers to WooCommerce customer sessions on login
  • Compatible with object caching

Testing WooCommerce Integration

Test Scenarios

  1. New customer registration:

    • Sign up on My Account
    • Verify customer role assigned
    • Check welcome email
  2. Existing customer login:

    • Sign in on checkout
    • Verify account linked
    • Check order history
  3. Guest checkout then account:

    • Complete order as guest
    • Use Thank You linking
    • Verify orders merged
  4. Cart persistence:

    • Add items as guest
    • Sign in with Google
    • Verify cart preserved

Troubleshooting

Button Not on Checkout

Causes:

  1. PRO feature not activated
  2. Checkout template override
  3. JavaScript conflict

Solutions:

  1. Verify PRO license
  2. Check theme templates
  3. Test with default theme

Cart Not Preserved

Causes:

  1. Session configuration
  2. Caching issue
  3. Plugin conflict

Solutions:

  1. Check session settings
  2. Exclude from cache
  3. Test plugins individually

Orders Not Linking

Causes:

  1. Email mismatch
  2. Thank You linking disabled
  3. Multiple email addresses

Solutions:

  1. Verify email matches
  2. Enable Thank You linking
  3. Check order customer_id

Best Practices

Do's

  • Enable on My Account at minimum
  • Test checkout flow thoroughly
  • Use Thank You page linking
  • Track UTM data for attribution

Don'ts

  • Don't disable for logged-in users
  • Don't skip checkout testing
  • Don't ignore mobile experience
  • Don't override core templates without testing

Next Steps