searchdiscovery / brookings-datalayer-specs

An Apollo generated Event Driven Data Layer
0 stars 1 forks source link

Contact Us Completed #11

Open jerry-bennett opened 1 year ago

jerry-bennett commented 1 year ago

Contact Us Completed

Javascript Code

window.dataLayer = window.dataLayer || [];
dataLayer.push({ event_data: null });  // Clear the previous event_data object.
dataLayer.push({
  "event": "contact_us_complete",
  "detailed_event": "Contact Us Completed",
    "event_data": {
        "author": "<author>",
        "contact_purpose": "<contact_purpose>",
        "method": "<method>"
    }
});

Variable Definitions

Path Type Description Example Pattern Min Length Max Length Minimum Maximum Multiple Of
event_data.author string The expert(s) who have created the content; can include a comma separated list of authors Sandra Rozo, Hernan Winkler
event_data.contact_purpose string Captures the reason that a visitor submitted a Contact Us form. General Inquiry, Order Status, Legal, Other
event_data.method string Captures the website method (i.e. search, top nav) used to find each product. email, facebook, twitter
jerry-bennett commented 1 year ago

Tested on: https://preview.brookings.edu/contact-brookings/

Use case: Filled out the contact form and submitted it.

Status: Looking good, seeing it in gtm as well as the data layer. Not seeing the 'author' variable populate though, @jmoconn do you know a use case where this value would be populated?

Image

Image

jmoconn commented 1 year ago

Ah yea, that variable is only relevant for forms on expert pages. Here is an example @jerry-bennett : https://preview.brookings.edu/people/daphna-bassok/ -- if you click on 'email' next to the twitter handle in the hero, a modal will appear with a form.

jerry-bennett commented 1 year ago

Got it thank you! Tested that scenario and saw the 'author' variable being populate, but it's populated as 'undefined'. Is that what you're expecting @jmoconn? Also saw it in GTM as well.

Image

Image

jmoconn commented 1 year ago

Should be updated now -- let me know if you're still seeing undefined!

jerry-bennett commented 1 year ago

Looks good now! Moving this to done.

Image

jerry-bennett commented 1 year ago

PROD QA:

Tested on: https://www.brookings.edu/people/daphna-bassok/

Use case: Clicked on 'email' then filled out the form with test values and hit submit.

Status: Looking great, seeing the correct data layer push and the tag fire in GTM as well.

Image

Image