Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Analytics Champion Program are open!
SOLVED

OnClick Not adding to Debugger?

Avatar

Level 2

We are using S_Code H.25.4 on our site currently. 

We use a JS "on click" command when we have a PDF file download to force those files to report to Analytics.

 

(I do realize that I'm missing the ; in the appropriate spots on these screenshots. When they were in place between each evar definition it has the same results)

onClick - Filename and download only.png

The struggle we have is that we do not get all our other evars and props that we get with our page views. I tried modifying our OnClick link to add the other evars (and then I'll add sProps after I sort this out), and my link code looks like this now

onClick - OtherData Not Populating in debugger.png

The problem we have is... when I load this page, it populates all the correct variables, but when I click to download, it still only populates evar5 (below... Left column is the page load and the right column is the file download click)

 

Anayltics Debugger.png

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @Motoed-Work ,

 

Can you maybe try removing the spaces in your s.linkTrackVars? I've always coded mine as:

s.linkTrackVars = "eVar5,eVar6,eVar15,eVar21,eVar22,eVar23,eVar27,eVar32,eVar37,events";

 

And mine has always worked.. I've never tried with spaces, but that seem to be the biggest difference I can see at this time.

 

Also, not sure if it's intentional, but you seem to be setting eVar1 and not listing it in your linkTrackVars, perhaps that is a minor oversight?

 

If you are willing to share a link to your website (even if via a private message) I would be happy to take a look and see if anything else looks amiss.

View solution in original post

6 Replies

Avatar

Correct answer by
Community Advisor

Hi @Motoed-Work ,

 

Can you maybe try removing the spaces in your s.linkTrackVars? I've always coded mine as:

s.linkTrackVars = "eVar5,eVar6,eVar15,eVar21,eVar22,eVar23,eVar27,eVar32,eVar37,events";

 

And mine has always worked.. I've never tried with spaces, but that seem to be the biggest difference I can see at this time.

 

Also, not sure if it's intentional, but you seem to be setting eVar1 and not listing it in your linkTrackVars, perhaps that is a minor oversight?

 

If you are willing to share a link to your website (even if via a private message) I would be happy to take a look and see if anything else looks amiss.

Avatar

Community Advisor

@Jennifer_Dungan I think the same, @Motoed-Work eliminate the spaces in between eVars in linkTrackVars.

Screenshot 2024-04-18 at 9.01.53 AM.png

Avatar

Level 2

That solved it. Thank you both!

Is it also possible to just declare Props in this same string as well or does that need done differently? I tried adding this
s.linkTrackVars='eVar5,eVar6,eVar15,eVar20,eVar21,eVar22,eVar23,eVar27,eVar32,eVar37,Prop5,events';

But it didn't report in debugger.

Avatar

Community Advisor

I'm so glad that fixed it. Also, you 100% can add props, lists, products into this list. Try using "prop5" instead of "Prop5" in case it's case sensitive.....

 

I use the s.LinkTrackVars in my implementations, both from before Launch, and even now in my Launch implementation, and my props come through properly.