Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add div and id attributes so that contact form steps can be tracked #1317

Merged
merged 1 commit into from
Sep 24, 2018
Merged

Add div and id attributes so that contact form steps can be tracked #1317

merged 1 commit into from
Sep 24, 2018

Conversation

Tiggerito
Copy link
Contributor

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.

… phases of a contact form submission, and from that add contact form tracking.
@bigbot
Copy link

bigbot commented Jul 30, 2018

Autotagging @bigcommerce/storefront-team @davidchin

@bookernath
Copy link
Contributor

Makes sense to me! CC @mjschock

@Ubersmake Ubersmake merged commit c85d2b8 into bigcommerce:master Sep 24, 2018
Ubersmake added a commit that referenced this pull request Sep 24, 2018
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.

None yet

5 participants