Onclick GA Event

Posted in: Newspaper
Post count: 5

Hello! I’m having trouble setting up Google Analytics events that are counted by click (onclick events).

Every time I add the tag to any button available in the “formats” option, or in some text link, the event simply disappears from the code.

Can you help me?

Post count: 35449

Hi,

Please make sure that your code is set like this
https://www.screencast.com/t/yg17g2UOC

Thank you.

Post count: 5

Hi, Calin!
How are you?

Our GA code is fine. The problem appear when I try to insert the “onclick= “gtag(‘event’, ‘blog’, { ‘event_category’: ‘clique’, ‘event_label’: ‘clique cta 1’, });”” in a link or button.

When I put onclick tag and refresh the post, the onclick tag desapear.

https://files.slack.com/files-pri/T1B3YMUD8-FEXNV8ED8/image.png

  • This reply was modified 7 years by Jonesson.
Post count: 35449

Hi,

Lets make a test toughener, and see if the javascript is working
https://www.screencast.com/t/kv6WwYi2FyZ
https://www.screencast.com/t/5ZhYWYnKuSn
Results:
https://www.screencast.com/t/IwhvtErWmFM
https://www.screencast.com/t/FCAl7u35p785

If I do not understand well please provide some screenshots ( i can’t see your screenshots from slack ).

Thank you for your understanding.

Post count: 5

Hi, Calin!

Please, check the prints:

first, I added the script on the Custom JS Field: http://oi1383.photobucket.com/albums/ah318/Jonesson_Oliveira/Script_zpsxpxccye2.png

then, set the button code: http://oi1383.photobucket.com/albums/ah318/Jonesson_Oliveira/Cdigo_zpsya6rqq5v.png

So when I clicked the button, nothing happens: https://www.iquilibrio.com/blog/espiritualidade/umbanda-candomble/orixas-regentes-2019/

What I could observe is: when I add the script to the source code and simply save it, without switching to the view, the script stays and works perfectly.

When I add the script in the source code and alternate to the save view, it simply disappears.

By the way, this has happened quite largely with regard to saving layout settings. They always return to the pattern.

Can you help me?

Post count: 35449

Hi,

Please make a test, deactivate all non theme plugins, clear all cache and try again, if the problem persist try with a default theme.

Thank you.

Post count: 5

Hi, Calin!

How are you?

I had a test as solicitaded, but de problem persists. Should I reset the theme?

Thanks!

Post count: 35449

Hi,

Yes please, and make sure that you have the latest version of theme.

If there is still a problem, you can send us an email at contact@tagdiv.com and provide admin login, as well as cPanel or FTP if possible. We will take a look. Include a link to this topic in the email.

Thank you.

Viewing 8 posts - 1 through 8 (of 8 total)
The forum ‘Newspaper’ is closed to new topics and replies.