Expand my Community achievements bar.

Not able to fetch Datalayer variable

Avatar

Level 1

Hi All,

 

I am a beginner trying to learn Launch and was practicing. I created a sample 1 page and added data layer. I was trying to get the pageName variable using satellite call but getting as undefined.

Below is the data layer

    <script>
        var digitalData = {
            "page": {
                "pageInfo" : {
                    "pageName": "Home"
                    }
                }
        };
Data Element : digitalData.page.pageInfo.pageName
 
Rule custom code: console.log('The page name is '+_satellite.getVar('pageName'));
 
but getting the output as 
The page name is undefined
 
let me know if I am doing something wrong.
0 Replies