-
AuthorPosts
-
April 16, 2015 at 8:20 pm #429869
I’d like to track clicking lightbox videos (images with vimeo links) and images views with google tag manager, so I need to insert a bit of code every time lightbox opens, and to have access to lightbox url target as a parameter.
Is there some add_filter(blah-blah) for that, not to mess with main theme’s code?
- This topic was modified 9 years, 8 months ago by Vermishelle.
April 16, 2015 at 8:22 pm #429875BTW, every time I send a message to this forum, I have a blank screen after pressing “submit”. For a couple of few weeks now. Me only?
April 20, 2015 at 2:16 pm #431274Hi!
Sorry for the late reply!
Can you please post here the code you would like to add using http://pastebin.com/?
If you need to place the code inside Body tag, you can add following code to Functions.php file in Appearance > Editorfunction add_custom_tooltip(){ ?> YOUR CODE GOES HERE INCLUDING SCRIPT TAGS <?php } add_action('wp_footer', 'add_custom_tooltip');
Thanks for the report. Few other users reported the issue but have not been able to reproduce it yet, but we are looking into it :)
Regards,
YigitApril 20, 2015 at 2:29 pm #431283I managed to track vimeo lightbox runs in google tag manager, here’s what’s left to do: on every lightbox photo view I’d like to run this line of code:
dataLayer.push({'event': 'button1-click'});
or, as you asked
http://pastebin.com/gQpif6hYI need this code to run every time a new lightbox picture opens, including clicks on side arrows when a visitor thumbs through a gallery.
So, I’ll be able to count how many pictures a visitor has seen in lightbox, using google tag manager and google analytics.- This reply was modified 9 years, 8 months ago by Vermishelle.
April 21, 2015 at 12:20 pm #431919Hi,
Try adding that code to line 935 in js/avia.js, inside the
open
callback of the lightbox activation.Best regards,
JosueApril 21, 2015 at 1:55 pm #431972I tried before line 935, I tried after line 935, neither it didn’t work.
For simplicity, let’s test with this code of google analytics:
ga('send', 'event', 'test', 'test');
No test event happens in realtime events view window…
April 21, 2015 at 7:24 pm #432295Hm, if you put something like
console.log('some');
Do you see anything in the console when opening a lightbox?
Regards,
Josue -
AuthorPosts
- You must be logged in to reply to this topic.