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

Navigation Clicked #15

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

Navigation Clicked #15

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

Comments

@jerry-bennett
Copy link
Contributor

Navigation Click

Javascript Code

window.dataLayer = window.dataLayer || [];
dataLayer.push({ event_data: null });  // Clear the previous event_data object.
dataLayer.push({
  "event": "navigation_click",
  "detailed_event": "Navigation Click",
    "event_data": {
        "archived": <archived>,
        "author": "<author>",
        "author_id": "<author_id>",
        "author_type": "<author_type>",
        "center": "<center>",
        "format": "<format>",
        "historical_url": "<historical_url>",
        "language": "<language>",
        "module_name": "<module_name>",
        "original_post_id": "<original_post_id>",
        "parent": "<parent>",
        "post_id": "<post_id>",
        "primary_topic": "<primary_topic>",
        "project": "<project>",
        "publish_date": "<publish_date>",
        "region": "<region>",
        "subtype": "<subtype>",
        "tag_id": "<tag_id>",
        "tags": "<tags>",
        "template": "<template>",
        "topic": "<topic>",
        "type": "<type>",
        "word_count": "<word_count>"
    }
});

Variable Definitions

Path Type Description Example Pattern Min Length Max Length Minimum Maximum Multiple Of
event_data.archived boolean Whether the content has been archived Yes, No
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.author_id string ID for distinct author in Wordpress
event_data.author_type string Describes the type of author Guest Author, Expert, Leadership
event_data.center string Collection of topics and fellows organized under a program The Katzmann Initiative
event_data.format string Post type Page, Landing Page, Article, Event, Collection, Book and News
event_data.historical_url string URL of post from historical site /research/what-caused-the-u-s-pandemic-era-inflation/
event_data.language string Language in which the content is viewed en
event_data.module_name string Name of content module on homepage. e.g. Hero, Events, Latest Research hero, events, latest research
event_data.original_post_id string Original Post ID from historical site 20619
event_data.parent string "Parent" dropdown in the Post Options panel of the Wordpress Editor UI Events, Experts, Home
event_data.post_id string Unique content identifier 617631
event_data.primary_topic string Primary value selected in the CMS Global Economy
event_data.project string Initiatives tied to a research program Brookings Economic and Social Policy in Latin America Initiative
event_data.publish_date string Date the content was published. 2019-10-11
event_data.region string Geo Africa, Asia & the Pacific
event_data.subtype string Subtype of post Op-ed, Podcast, Testimony
event_data.tag_id string ID for distinct tag in Wordpress
event_data.tags string From Wordpress Post Editor under the "Tags" dropdown within the format dialogue. Covers "Series", "Blog". 17 Rooms Podcast, Africa in Focus
event_data.template string Template type in Wordpress Research & Commentary Landing
event_data.topic string List of comma separated themes that can be shared between programs Colombia, Global Economy
event_data.type string Type of post Commentary, Research
event_data.word_count string Total word count for content 389
@jerry-bennett
Copy link
Contributor Author

Tested on: https://preview.brookings.edu/articles/unpacking-the-chinese-readouts-of-blinkens-meetings-in-beijing/

Use case: Clicked on the "Experts" navigation option at the top left from this page.

Status: Looking good, seeing the data layer push and tag fire in GTM. Not seeing the project, subtype, or template variables populate though. @jmoconn is that expected for this article?

Image

Image

@jmoconn
Copy link
Collaborator

jmoconn commented Jun 27, 2023

For this particular article, that looks correct!

@jerry-bennett
Copy link
Contributor Author

PROD QA:

Tested on: https://www.brookings.edu/articles/unpacking-the-chinese-readouts-of-blinkens-meetings-in-beijing/

Use case: Clicked on the 'experts' navigation item at the top of the page.

Status: Looks great, seeing the correct data layer push and GTM tag fire

Image

Image

@jerry-bennett
Copy link
Contributor Author

@jmoconn are you expecting this event to fire on navigation elements on the homepage like this one?

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