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

Sign Up #17

Open
jerry-bennett opened this issue Jun 26, 2023 · 5 comments
Open

Sign Up #17

jerry-bennett opened this issue Jun 26, 2023 · 5 comments
Labels

Comments

@jerry-bennett
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link
Collaborator

jmoconn commented Jun 27, 2023

@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
Copy link
Contributor Author

@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
Copy link
Collaborator

jmoconn commented Jun 28, 2023

@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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants