Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

DTM Data Layer Basics

Avatar

Avatar
Validate 1
Level 1
craig_scribner1
Level 1

Likes

2 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
craig_scribner1
Level 1

Likes

2 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
craig_scribner1
Level 1

15-10-2015

I'm having trouble getting DTM to recognize my Data Layer variable. I don't know much about JS objects, so I think maybe my problem is just in how I define my Data Layer variable.

First in DTM I created a Data Element called Page_Name

[img]Page_Name.gif[/img]

Notice that I set the default value to "Unknown", which may seem redundant, but I couldn't get s.pageName to take a default value without doing that.

Next I created a Page Load Rule that sets Page name to my object: %Page_Name%

Finally, on my actual page I added this javascript:

    <script>
        //data layer
        var Page_Name = "Homepage"
    </script>

But when I save this page and refresh it, I'm still getting "Unknown" in my pageName parameter being sent to Omniture.

Thanks for your help!

Craig    

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 5
Employee
Rudi_Shumpert
Employee

Likes

8 likes

Total Posts

64 posts

Correct Reply

24 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 5
View profile

Avatar
Boost 5
Employee
Rudi_Shumpert
Employee

Likes

8 likes

Total Posts

64 posts

Correct Reply

24 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Applaud 5
Affirm 5
View profile
Rudi_Shumpert
Employee

15-10-2015

Craig,

When you create a Data Element that is pulling in a JS Object like you are attempting do to, you have to provide the name of that object in the "Path" form field.   That is where you would reference the JS variable on the page.  Also I would not name the Data Element the same thing as the JS object to help make it crystal clear what item you are trying to reference.

 

For more information on Data Elements, please consult the help guide:  https://microsite.omniture.com/t2/help/en_US/dtm/#Data_Elements

 

-Rudi

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 1
craig_scribner1
Level 1

Likes

2 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
craig_scribner1
Level 1

Likes

2 likes

Total Posts

9 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
craig_scribner1
Level 1

15-10-2015

thanks Rudi, that cleared it right up!