searchdiscovery / brookings-datalayer-specs

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

Sign Up #17

Open jerry-bennett opened 1 year ago

jerry-bennett commented 1 year ago

Sign Up

Javascript Code

window.dataLayer = window.dataLayer || [];
dataLayer.push({ event_data: null });  // Clear the previous event_data object.
dataLayer.push({
  "event": "sign_up",
  "detailed_event": "Sign Up",
    "event_data": {
        "event_count": "<event_count>",
        "newsletter_name": "<newsletter_name>",
        "program": "<program>"
    }
});

Variable Definitions

Path Type Description Example Pattern Min Length Max Length Minimum Maximum Multiple Of
event_data.program string Captures the research program for the content Global Economy and Development
jerry-bennett commented 1 year ago

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

Use case: Scrolled down to 'Subscribe to the Brookings Brief' and entered in a test email then hit submit.

Status: Looking good, seeing it fire correctly in GTM as well as the data layer push. However, not seeing the value for 'newletter name' or program. @jmoconn do you know of an example where the values would be populated?

Image

Image

jmoconn commented 1 year ago

@jerry-bennett where did you test this one? Most of the subscribe modules on the site should be passing in at least a name, and a program if applicable (it's not always applicable). But I might have missed adding the name somewhere

jerry-bennett commented 1 year ago

@jmoconn I tested this on the main homepage, under the 'subscribe to brookings brief' module. That could be why there's no data for newsletter name or program.

jmoconn commented 1 year ago

@jerry-bennett ha! I think you found the only subscribe module that I missed in adding names. I've added the name to that one now. This particular newsletter is not associated with a program, which is why no program is populating here. Here's an example that does have a program associated (if you scroll down the page, you'll see a little popup in the lower right hand corner to subscribe to a newsletter).

jerry-bennett commented 1 year ago

No worries glad I was able to find a fringe case! I checked again and everything is looking good on the example you provided. Also seeing the newsletter name pop up in the first example now. Moving this to complete.

Image

Image