• After adding gaq push events in the code, WordPress will strip the coding out if I switch to the visual editor. As I am not the only person making changes on these websites, this can end up with the push event being removed without my knowledge. Obviously, this impacts our reporting in Google Analytics.

    I’ve read on other forums that other CMS have removed this stripping function. How can I either change WordPress to not strip the code, or is there a plugin to use to ensure that the code isn’t stripped?

    Just to be clear, this is the onClick gaq push event.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Don’t switch editing tabs. That’s the fastest way to remove some (or all) of your markup. Pick a tab and stick to it.

    Thread Starter gensd

    (@gensd)

    I have other people, who are not code savvy at all, that edit pages on the websites. Not switching tabs is not a solution.

    Thread Starter gensd

    (@gensd)

    I’m still having to repair changes accidentally made by other people working on the websites, any other ideas for this?

    I am having similar issues. What I have noticed is that it strips/hides the code from the WordPress Editor but must not remove it, because it still shows up in the page source.

    I have no idea what to do if I want to change or remove the code. My only difference from your situation is that I am using the code required for universal analytics.

    Does your push event code still show up in your page source?? I also forced a clean cache to confirm.

    all of the above is happening for me as well! Code stays in (as verified by viewing source) but is no longer visible in either editors.

    Anyone else encounter this, and if so any fixes?

    I am having the same problem. It seems like a major flaw to me that code can be wiped out simply by having someone view the page in the Visual tab when this is a CMS that can have multiple authors.

    I tried putting the tag around my link to preserve the GA event code, but it still got wiped out. Disappointing.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Google Analytics push event code being stripped when switching to Visual Editor’ is closed to new replies.