Skip Navigation

[Resolved] javascript link breaks front-end output

This support ticket is created 5 years, 11 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 4 replies, has 2 voices.

Last updated by diyanK 5 years, 11 months ago.

Assisted by: Beda.

Author
Posts
#903758

Hi, I am trying to update my client's privacy policy which requires having a link in the following format:

<a href="javascript:gaOptout()">click here</a>

This is required to comply with the GDPR coming in action today.

Upon including this link, the whole paragraph where it should reside in disappears from the front-end.

If I remove the "javascript:gaOptout()" part. Everything works as expected.

Please advise ASAP.

#903890

I need to know where you insert this.

Then I can replicate it, as currently, neither in Layouts Text Editors nor Content Templates this is an issue on my tests.

As well, I am confused about the requirement of "javascript:gaOptout()" - this does not seem to be a requirement of GDPR.
GDPR is about granting possibilities for users to delete or and control their data, not about how you have to craft URL referrers.
Or is this about Google Analytics DataProtection as elaborated here?
hidden link
(Sorry, this is in German, but it seems to be something used to agree/disagree on tracking by Google itself?)

I might miss a detail, please do not hesitate to update me in regard.

However, the link works on my tests.
It produces a valid link output on the front end.

#904022

Yes this is regarding the possibility of people being able to Opt-out from being tracked via Google Analytics.
It is not my decision to include it on the privacy policy page but my client's.

It is on the privacy policy page. I have already selected the website to which this ticket refers to.

I am inserting this into the Layouts Editor / Visual-text editor.

Currently the "click here" link is set to "#" to avoid triggering the issue.

Thanks for looking into this.

#904263

I understand, and I have to apologise as I should have known about this, I wonder as well how I "made this even work in the visual editor cell", as it simply does not - I must mistakenly have used the Content Template Cell.

See, Layouts has security mechanisms in place to avid to add JS to any of the text editors.

You should, for this sort of code, use a Content Template.

Please proceed as instructed below:
- Create a Content Template
- Insert your code
- Head to the Layout, insert a Content Template cell and choose the previously created Template
- Save the Layout

It should work now.
Can you confirm this?

PS
I absolutely understand it is not you making those rules or including the parts as outlined, and we at Toolset are 100% committed to helping you manage this new (and major) law that the EU created.
My curiosity was due to the goal to learn more about and increase my own knowledge so to help others later.

Thank you for your feedback and patience!

#904381

Thanks, that fixed it.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.