• Is there a way to add Google Analytics event tracking to the lightbox shortcode? This would allow me to view the number of times a video was viewed in the lightbox.

    In essence, I would like to add the following code to the link code:

    onClick=”ga(‘send’, ‘event’, ‘video’, ‘video-play’, ‘Video Name’);”

    Adding it within the shortcode after the anchor as shown below does not work.

    [video_lightbox_vimeo5 video_id=”111111111″ width=”640″ height=”480″ anchor=”http://www.domainname.com/imagename.jpg” onClick=”ga(‘send’, ‘event’, ‘video’, ‘video-play’, ‘Video Name’);”]

    Has anyone else had luck adding the GA event tracker?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support mbrsolution

    (@mbrsolution)

    Hi, have you tried any of the plugins available in WordPress repository?

    Hello,

    You can customize the link this way:

    <a href="https://www.youtube.com/watch?v=G7z74BvLWUg" rel="wp-videolightbox"
    title="">Click Me</a>

    And add all the code you need in the <a > tag as normally.

    Didn’t test with the GA code but it should work.

    • This reply was modified 7 years, 6 months ago by saxisme.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add Google Analytics Event Tracking’ is closed to new replies.