How to get values from vanilla
Hello,
I'm new to Vanilla and have not much idea how it works under the hood.
We are assigned a task to fetch some values and store them in a json code.
I'm pasting the code below, we are supposed to fill the actual data for placeholders like '<brand>', '<country>' etc.
I was able to get some user data using getCurrentUser. I tried getCurrentPage and getCurrentPost but got "function not defined" error.
window.dataLayer = window.dataLayer || [];
dataLayer.push({ page_data: null }); // Clear the previous event_data object.
dataLayer.push({
event: 'page_view',
page_data: {
brand: '<brand>',
country: '<country>',
language: '<language>',
destination_URL: '<destinationURL>',
page_category: '<page_category>',
page_subcategory: '<pageSubCategory1>',
page_location: '<page_location>',
page_referrer: '<page_referrer>',
page_title: '<page_title>',
page_type: '<pageType>',
region: '<region>',
site_section: '<site_section>',
system_environment: '<sysEnv>',
experience_type: '<experienceType>'
},
user_data: {
user_id: userID,
user_login_state: '<user_login_state>',
user_type: userType,
}
})
});
Kindly, help me to get the information or if there is some documentation then point me in that direction.
Any help is greatly appreciated.
Thank you all