1. SP Page Builder 3.x
  2. Saturday, 28 April 2018
Hi!
I have a button. (id="btn-1521922268430";)
https://snag.gy/JiZlvU.jpg

I neen to add the JavaScript to track "click button" event (for Google and Yandex analytics).
I need to add for "btn-1521922268430" the following code: onclick="yaCounter37719736.reachGoal('btn333'); return true;"

How and where can I do this? If possible, please provide an example!
It would be nice to be able to add additional functions directly to the button fields in the SPPB.
Responses (3)
Paste this code before </ body>. And do not forget to wrap it with the script tags:

window.addEventListener('load', function(){
document.getElementById('YOUR_BTN_ID').setAttribute("onclick", "yaCounterYOUR_COUNTER_NUMBER.reachGoal('YOUR_TARGET_ID'); return true;");
});

http://dl3.joxi.net/drive/2018/04/29/0008/0401/545169/69/fd4de975f0.png
  1. more than a month ago
  2. SP Page Builder 3.x
  3. # 1
Thanks Pavel, I will try!
  1. more than a month ago
  2. SP Page Builder 3.x
  3. # 2
Thanks Pavel, it works!:D
  1. more than a month ago
  2. SP Page Builder 3.x
  3. # 3


There are no replies made for this post yet.
Be one of the first to reply to this post!


This forum is archived

This forum has been archived. Please use JoomShaper official support system.