Home > widget-integration > CountdownTimerController > bindEntireBarClick

CountdownTimerController.bindEntireBarClick() method

Bind click and keyboard handlers for the "entire bar clickable" CTA mode.

Reads the navigation URL from the data-timer-cta-link attribute and attaches click and keydown (Enter/Space) listeners.

Signature:

protected bindEntireBarClick(): void;

Returns:

void

Example

Override to add analytics before navigation:

protected bindEntireBarClick() {
  super.bindEntireBarClick();
  const bar = this.element?.querySelector('[data-timer-cta-link]');
  bar?.addEventListener('click', () => {
    window.dataLayer?.push({ event: 'countdown_cta_click' });
  });
}