Add div and id attributes so that contact form steps can be tracked#1317
Merged
Ubersmake merged 1 commit intobigcommerce:masterfrom Sep 24, 2018
Tiggerito:contact-form-tracking
Merged
Add div and id attributes so that contact form steps can be tracked#1317Ubersmake merged 1 commit intobigcommerce:masterfrom Tiggerito:contact-form-tracking
Ubersmake merged 1 commit intobigcommerce:masterfrom
Tiggerito:contact-form-tracking
Conversation
… phases of a contact form submission, and from that add contact form tracking.
|
Autotagging @bigcommerce/storefront-team @davidchin |
Contributor
|
Makes sense to me! CC @mjschock |
bookernath
approved these changes
Aug 22, 2018
junedkazi
approved these changes
Sep 21, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
This is my first ever submission like this on GitHub. Please tell me if I've got it all wrong.
The contact form is single page, which means it is very hard for people to track form submissions on systems like Google Analytics. There is no success page to track it as a goal.
I've developed a way to hook into the page and detect user activity via JavaScript, this JavaScript can directly send a signal to Analytics so that it can track submissions.
But my solution, and probably anyone elses requires some minor edits to the theme.
The code needs to detect if certain elements are present. These elements indicate if the page has been submitted, or if the submission had errors (also useful to track). However the theme does not include an easy way to find those elements, and there are not always clean elements to detect.
The edits add id attributes to some div elements and add some div elements with id attributes. This makes it possible to detect if the page is a contact page and if it currently contains a success or error messages.
With that, people can write JavaScript to detect what is going on in the page. And most importantly, detect if the form was successfully submitted. With Google Analytics, events or fake page views can be sent which can be used to trigger a contact form sent goal.
Tickets / Documentation
I raised the issue a while ago.
#1114
And decided to have a go at making the fix myself.
I could not work out how to raise this change under the issue.
Screenshots (if appropriate)
Nothing is visible.