How can I trigger the function when the form is submitted in Bricks Builder?

Hi friends, I’ve built a landing page using Bricks Builder, and I need code that sends data to the data layer when the form is submitted. So far, I haven’t found any resources that explain how to do it.

Usually, I build websites with Elementor, and when I want to trigger something upon form submission, I place this script in a tag manager, and it works:

jQuery(document).ready(function($) {
$(document).on(‘submit_success’, function(evt) {
dataLayer.push({
‘event’: ‘form_submit’,
‘event_name’: ‘form submit’,
‘form_name’: evt.target.name,
});
});
});

Can anyone help me solve this?