Class: Vendors::GoogleReserve::ConversionTrackingWorker

Inherits:
ApplicationWorker
  • Object
show all
Defined in:
app/workers/vendors/google_reserve/conversion_tracking_worker.rb

Overview

ConversionTrackingWorker is a Sidekiq worker that handles Google Reserve conversion event tracking

This worker sends conversion events to Google when reservations are created through Google Reserve, enabling Google to track the effectiveness of their reservation integration and providing attribution data for restaurant performance metrics.

Job Configuration

  • Queue: :critical (high priority processing)

  • Retry: 2 attempts on failure

  • Lock: :until_executed to prevent duplicate concurrent executions

  • Backtrace: enabled for better error debugging

Process Overview

  1. Receives a reservation_id parameter when enqueued

  2. Delegates to VendorsService::GoogleReserve::ConversionTrackingService

  3. Service validates reservation and sends conversion event to Google

Dependencies

  • VendorsService::GoogleReserve::ConversionTrackingService: Contains all business logic

  • Reservation model: Must exist and be valid for Google Reserve conversion tracking

Usage

Vendors::GoogleReserve::ConversionTrackingWorker.perform_async(reservation.id)

Instance Method Summary collapse

Instance Method Details

#perform(reservation_id) ⇒ void

This method returns an undefined value.

Main entry point for Google Reserve conversion tracking Delegates to VendorsService::GoogleReserve::ConversionTrackingService

Parameters:

  • reservation_id (Integer)

    The ID of the reservation to track conversion for



34
35
36
37
# File 'app/workers/vendors/google_reserve/conversion_tracking_worker.rb', line 34

def perform(reservation_id)
  service = VendorsService::GoogleReserve::ConversionTrackingService.new(reservation_id)
  service.send_conversion_event
end