Expand my Community achievements bar.

SOLVED

Trying to use innerHTML to capture dynamic event values, but not working

Avatar

Level 4

I tried using inner.HTML to capture the value for the tabs. I need to know if I did it correctly because the prop is not firing. I am trying to capture the values for each href for pamphlet, article and chapter. Below the code, you can what I did under conditions and Adobe Analytics to set the tracking up.

 

<dd class="active" id="page_scan_tab">

                   <a role="tab" href="#page_scan_tab_contents">Pamphlet</a>
               </dd>

<dd class="active" id="page_scan_tab">
                   <a role="tab" href="#page_scan_tab_contents”>Article</a>
               </dd>

<dd class="active" id="page_scan_tab">
                   <a role="tab" href="#page_scan_tab_contents”>Chapter</a>
               </dd>

 

Under the Conditions, I added the following.

Element Tag or Selector: I added "a"

Property: I added "href"

Value:  I added "#page_scan_tab_contents"

Under Adobe Analytics, I set the prop as follows:

prop73=%this.innerHTML

The tracking is not firing for prop 73. Can anyone provide any feedback as to what I did wrong?

 

Thank you,

Bill

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

HI Bill,

 

I have changed the condition of the rule and it is now fired : SATELLITE: Rule "Content tab test 2" fired.

 

The image request contains prop73 with the right value :

 

  1. AQB:
    1
  2. ndh:
    1
  3. pf:
    1
  4. t:
    26/7/2015 12:28:41 3 -60
  5. D:
    D=
  6. mid:
    15540699278863072830582516998898801120
  7. aid:
    2AE8FCA285313023-40000102E0055CCC
  8. aamlh:
    6
  9. ce:
    UTF-8
  10. pageName:
    article view
  11. g:
  12. cc:
    USD
  13. pe:
    lnk_o
  14. pev2:
    test
  15. pid:
    article view
  16. pidt:
    1
  17. oid:
  18. ot:
    A
  19. c73:
    Article
  20. s:
    1920x1080
  21. c:
    24
  22. j:
    1.6
  23. v:
    Y
  24. k:
    Y
  25. bw:
    574
  26. bh:
    955
  27. AQE:
    1

Best regards.

 

 

Alexis Cazes

 

 

Senior Technical Support Engineer

View solution in original post

11 Replies

Avatar

Community Advisor

Hi,

 

Are you trying to use the option in this article described by Jan Exner ?

http://webanalyticsfordevelopers.com/2014/12/16/with-dtm-you-dont-need-data-elements/

I noticed that you missed a % at the end of "prop73=%this.innerHTML"

Or Are you trying to use Data Elements in DTM ?

Please provide the following details for me to review the issue further:

  • DTM Company:
  • DTM Web property:
  • DTM rule:
  • DTM Data element

Best regards.

 

Alexis Cazes.

 

Senior Technical Support Engineer

Avatar

Level 4
When I used the DTM bug mode, I was not seeing it fire. How do I change the property to see regex? Also, I am out of the office this week. I can't make any updates until this Sunday. Bill

Avatar

Level 4
The DTM company is Ithaka The Web property is JSTOR I am using a event based rule The rule name is Content tab test 2 I did read about the innerHTML in an article, but I don't remember which one. I do have the % at the end in the data element and the tracking did not work. I really appreciate your help with the issue. Bill

Avatar

Community Advisor

Hi Bill,

 

In the condition you need to delete you exisiting property and recreate a new one.

When you create it a switch box for regex will be present, switch to green and it should be using regex. 

[img]regex enabled.png[/img]

Best regards.

 

Alexis Cazes

Avatar

Community Advisor

Hi Bill,

 

Are you able to see the rule being fired in the console when you enable DTM debug mode when you click on the link at all ? 

If you cannot change slightly the condition for the property href to check against regex and it should work.

Let me know what you see after that.

 

Best regards.

 

Alexis Cazes.

 

Senior Technical Support Engineer

Avatar

Level 4

I updated the tracking with the regex and it is still not working.

 

Bill

Avatar

Community Advisor

Hi Bill,

Can you provide me the source code or the URL where you have implemented DTM ? 

I will check and get back to you with a solution.

 

Best regards.

 

Alexis Cazes

Avatar

Level 4

Here are a couple of URLs where the tabs use the same CSS selector, but need to report different results.

 

http://www.jstor.org/stable/27886895  -  Tab name is "Article"

http://www.jstor.org/stable/10.5749/j.ctttt28q.13 - Tab name is "Chapter"

 

Thank you,

Bill

Avatar

Correct answer by
Community Advisor

HI Bill,

 

I have changed the condition of the rule and it is now fired : SATELLITE: Rule "Content tab test 2" fired.

 

The image request contains prop73 with the right value :

 

  1. AQB:
    1
  2. ndh:
    1
  3. pf:
    1
  4. t:
    26/7/2015 12:28:41 3 -60
  5. D:
    D=
  6. mid:
    15540699278863072830582516998898801120
  7. aid:
    2AE8FCA285313023-40000102E0055CCC
  8. aamlh:
    6
  9. ce:
    UTF-8
  10. pageName:
    article view
  11. g:
  12. cc:
    USD
  13. pe:
    lnk_o
  14. pev2:
    test
  15. pid:
    article view
  16. pidt:
    1
  17. oid:
  18. ot:
    A
  19. c73:
    Article
  20. s:
    1920x1080
  21. c:
    24
  22. j:
    1.6
  23. v:
    Y
  24. k:
    Y
  25. bw:
    574
  26. bh:
    955
  27. AQE:
    1

Best regards.

 

 

Alexis Cazes

 

 

Senior Technical Support Engineer

Avatar

Level 4

I see the rule firing now. Thank you for all of your help on this.

 

Bill

Avatar

Level 4

Alexis,

Was the update you made based on the image you provided in an earlier post? I tried to create it that way, but it did not get it to work. I am sure I missed something.

 

Thanks,

Bill