Skip to content

fix(component-header-footer): fix arbitrary timeout in header submit …#1712

Open
davidornelas11 wants to merge 1 commit into
devfrom
UDS-1612
Open

fix(component-header-footer): fix arbitrary timeout in header submit …#1712
davidornelas11 wants to merge 1 commit into
devfrom
UDS-1612

Conversation

@davidornelas11

Copy link
Copy Markdown
Contributor

…function

Description

Checklist

  • Tests pass for relevant code changes

Important Reminders

Links

@davidornelas11 davidornelas11 requested a review from a team as a code owner June 4, 2026 23:28
@asu-jenkins-devops

Copy link
Copy Markdown
Collaborator

region = "",
component = "",
eventCallback,
eventTimeout,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should eventTimeout have a numeric default = 0?

component: component.toLowerCase(),
};
if (dataLayer) dataLayer.push(e);
if (eventCallback) e.eventCallback = eventCallback;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const e, previously an object of strings, we are now sending a function to data layer (Just bringing this up for discussion).

if (dataLayer) {
dataLayer.push(e);
} else if (eventCallback) {
eventCallback();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are adding a feature to this shared component, I don't think there is anything wrong with this, but I would like to discuss.

// Fallback: always submit within 2s regardless of GTM state. Useful for
// cases where GTM fails to load or execute for any reason, or if the user
// has blocked GTM.
setTimeout(submit, 2000);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the comment about GTM state, however I think the function for trackGAEvent should always execute regardless of GTM setTimeout(submit, 2000); not needed here.

if (dataLayer) {
dataLayer.push(e);
} else if (eventCallback) {
eventCallback();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setTimeout(submit, 2000);

Do we need to add a callback parameter and a timeout parameter?

Timeout could be added inside callback? Callback = ()=>{ setTimeout(submit, 2000); }

GTM can see Form submission natively, without dataLayer method.

I know we have talked about this before, but I'd like to discuss again to make sure we have all options before adding a 2 second timeout to all submissions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants