Open rossozburnsdi opened 1 year ago
Hi @rossozburnsdi ,
Moving to SDI Review, please let us know for queries.
Thanks
Tested on: http://xactlystg.prod.acquia-sites.com/
Use case: Loaded the page with the form and clicked on the first text box.
Status: Working as expected, event does not fire until I click on the form. Works on both the 'contact us' form and 'request a demo' form. @milind0299 I do think there's an issue with the implementation where two events fire for each form. One is null with no information and the other is what is expected. Not super critical but worth looking into.
Hi @jerry-bennett ,
window.dataLayer = window.dataLayer || [];
dataLayer.push({ event_data: null }); // Clear the previous event_data object.
dataLayer.push({
"event": "form_field_interaction",
"detailed_event": "Form Field Engaged",
"event_data": {
"field_name": "
the line in bold fires in the code. Sure will look into it and remove the line.
Thanks
Hi @jerry-bennett ,
I have removed the line in the code that was causing the null object for all events.
Thanks
@milind0299
Tested on: https://xactlystg.prod.acquia-sites.com/company/contact-us
Use case: Loaded the page with the form and clicked on the first text box.
Status: @milind0299 This is working but can we change this. Instead of firing on each click of the form field can you change it be onchange of the field. We are mainly looking to have this only first change of the form field. We are trying to avoided inflating the numbers.
Hi @rossozburnsdi ,
As per the new scenario, now the click will be fired only once
Thanks.
Hi @rossozburnsdi ,
As per our discussion yesterday. Now when the form field is clicked , form_started event will be triggered once and on filling each and every field form_field_interaction will be triggered. Do let us know for queries.
Thanks
@milind0299 This is not what we discussed on the call. We are looking for form_start to fire on the the first click of the form (i.e. the first name field).
Form Field Engaged should only fire when the user types in the form input fields. However, we are looking for this to only push to the data layer only once. i.e. If the user fills out the first name field but spells their name wrong and continues to fill out the form then updates the first name field with the correct name. The data layer event should only fire once.
Below is an example function of what we are looking for. We can discuss on Tuesday's call if this is still unclear.
var acFields = window.acFields = window.acFields || [];
var inFieldsArray = 'no';
for (var i = 0; i < acFields.length; i++) {
if (acFields[i] == element) {
inFieldsArray = 'yes';
}
}
if (inFieldsArray == 'no') {
dataLayer.push({
'event': 'form_change',
'field_name': element,
})
}
window.acFields.push(element);
};
//Change listener on first name
jQuery('input[name*="FirstName"]').change(function() {
var le = 'first name';
detectChange(le);
});
//Change listener on last name
jQuery('input[name*="LastName"]').change(function() {
var le = 'last name';
detectChange(le);
});
Tested on: http://xactlystg.prod.acquia-sites.com/company/contact-us
Use case: Clicked on the first box for "Let's Talk" and started typing.
Status: Looks great! Does not fire until I type, and the data layer push and network call are looking good. Also seeing the tag fire in GTM.
Not seeing this occur on all form fields.
This is not a blocker. XAC dev team will revisit this after go live.
PROD QA: @rossozburnsdi
Tested on: https://www.xactlycorp.com/company/contact-us
Use case: Loaded form, clicked on it, and started typing.
Status: Not working, seeing the correct data layer push but not seeing the network call.
Tested on: https://www.xactlycorp.com/company/contact-us
Use case: Loaded form, clicked on it, and started typing.
Status: Seeing the correct data layer push and seeing the network call.
Form Field Engaged
User interacts with any form on the site. Events will apply to all forms
Example Screenshot:
Javascript Code