3D FlipBook - Tracking single flipbook page views using GTM standard tag


Hi We where using this method, which you suggested some time ago, to track as pageviews the individual pages of the flipbook

function ready(scene) { scene.ctrl.addEventListener('endFlip', function(e) { flm_gtag(scene); }); scene.book.enableMouse(false); } ready;

function flm_gtag (scene) { gtag( 'event', 'page_view', { 'page_path': location.pathname + "/" + scene.ctrl.getPageForGUI(), }

We get on Google Analytics this result, which is what we need

/3d-flip-book//2 /3d-flip-book//4

Now we have switched to Google Tag Manager, installing the standard GTM tag on all pages, and we no longer receive data from individual pages in the flipbook, because gtag is not defined.

We tried to use solutions like

function flm_gtag (scene) { parent.dataLayer.push({ 'pageview': ...

but it doesn't work, I think because GTM tracks only the first page view, any other page view pushes are ignored, and in fact we see on Google Analytics


Could you suggest an alternative method to keep track of individual pages in the flipbook as pageviews using GTM tag?

Or should we define individual pages in the flipbook not as pageview but as user-defined events?

Or, again, or it would be better not to use GTM tag on 3d-flip-book pages but the gtag javascript, as we did before?

Thanks in advance, Luca



Did you manage to get a solution for the above issue? I have the same problem and have bought the plugin 2 months ago, but I still can't pull the stats on all the flipped pages.


I haven't received any answers yet, and I haven't found a structural solution. For now I have solved using the GTM tag for all pages except those of custom post type 3d-flip-book, detected in wp-head via Wordpress get_post_type function. For those I include the "old" Universal Analytics code, compatible with the code used in function ready(scene) of 3dFlipBook, see my answer above. It's not particularly elegant, but page views of flip navigation are reported correctly on Google Analytics. Hope that helps, please let me know. If you have any alternative ideas, you are welcome....

Log In to leave a comment