Important! Google Analytics Mobile Opt-Out Update -> Javascript in rich text editor

Explorer
89 0 58

Hi,

this is really a serious problem - everyone in europe is risking warnings if not implemented! 

There is a new script from google which allows visitors to deactivate tracking by clicking on a link. They did this, because the add-on doesn't work for mobile devices.

This link needs to be placed in the privacy policy and it's a javascript like this:

<a href="javascript:gaOptout()">Deactivate Google Analytics</a>

The problem is, that the rich text editor doesn't recognize it (I already placed the script into the additional google analytics javascript in "settings/online store").

So the problem is to create the link in the privacy policy.

 

Thanks in advance for your help and kind regards

Marco

0 Likes
Shopify Expert
10008 116 1844

The RTE is a really pain sometimes. Worst case you *could* add the link like so:

<a href="[ga-optout]">foo</a>

and then edit your page template:

{{ page.content | replace:'[ga-optout]','javascript:gaOptout()' }}

Ideally I like to see the RTE be a little more forgiving.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Explorer
89 0 58

Hi Jason,

thanks for your help. I'll try that.

Alternative: to create a custom template and put the content in there should be fine as well, right?

Cheers

Marco

0 Likes