OnClick Not adding to Debugger? | Community
Skip to main content
New Participant
April 17, 2024
Solved

OnClick Not adding to Debugger?

  • April 17, 2024
  • 1 reply
  • 1065 views

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)

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

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)

 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Jennifer_Dungan

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.

1 reply

Jennifer_Dungan
Jennifer_DunganAccepted solution
New Participant
April 17, 2024

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.

Krishna_Musku
New Participant
April 18, 2024

@jennifer_dungan I think the same, @motoed-work eliminate the spaces in between eVars in linkTrackVars.

New Participant
April 18, 2024

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.