Skip to content

Adding custom Javascript to Flipbooks

Flipbooks DesktopHow-to3 min read14 views

Tagged

You’ll end up with your own JavaScript running inside your flipbook, delivered through Google Tag Manager instead of pasted into the software.

You’ll need

  • A Google Tag Manager account.
  • Flipbooks Desktop 9.3 or later — 3D Issue’s own walkthrough records Tag Manager as added in 9.3.
  • The flipbook you want the JavaScript to run in.

Google Tag Manager can be used to add custom JavaScript to your flipbooks. The tutorial below walks through setting up Tag Manager and adding your script.

1. Create a Google Tag Manager account.

Start by creating and setting up a Tag Manager account.

  1. Head over to Google Tag Manager and sign in with your Google Account to start creating an Account.
  2. When signed in, you’ll need to create your first Tag Manager account. Click Create Account
    Screenshot showing Google Tag Manager
  3. On the next page give your new Account a name, this can be anything. Select your Country and click Continue
    The Tag Manager Add a New Account wizard: the account name Demo Publications and the country set to Ireland, with Continue beneath.
  4. Then give your Container a name. Containers represent your website, pages, apps etc. The container for the web is the one to use, so select that too.
    The wizard's Set-up Container step: the container name Chat publications and the Web, iOS, Android and AMP targets, with Web selected.
  5. Agree to the terms & privacy policy if prompted.
  6. You’ll be brought into your new Tag Manager workspace, and will likely be prompted to Install Google Tag Manager, click OK
    The Install Google Tag Manager dialog, showing the head and body snippets and the close button arrowed.
  7. Click Add a new tag
    Add a new tag
  8. Give your new Tag a name, you can give it any name, choose one that’s relevant though so it’s easy to recognize.
  9. Click Tag Configuration to start adding your tag. In the pane that opens scroll down and select Custom HTML
  10. In here you can enter your Javascript. You can include it as a linked resource or in an inline script tag.
    Paste in Script
  11. Scroll down to Triggering and click it.
  12. In the Pane that opens, check the box beside All Pages and click Add in the top right corner.
  13. Click Save
  14. You’ll be brought back to your Tag Manager Workspace.
    Tag Manager requires you to Submit or Publish changes, so do that.
  15. Click Submit in the top right corner
    Click Submit
  16. Give your Version a name (This can be anything). Click Publish
  17. Switch back to the workspace Tab in Tag Manager and click the GTM id along the top bar.
    Click the ID
  18. In the Dialog that opens, locate and copy the GTM id.
    Copy the ID
  19. And that is Tag Manager setup with your Javascript. Now add Tag Manager to the Flipbook.

2. Add your Tag Manager ID to your Flipbook

  1. Launch 3D Issue 9.3 on your Computer and open or create the Flipbook you wish to add your javascript to.
  2. In the Content tab select the correct template and profile. Then select Setup
  3. In the window that opens select the Domains tab and next to the domain(s) your Flipbook will appear under paste in the Tag Manager ID copied earlier.
  4. Click Next, then Finish
  5. Now switch to the Design tab.
  6. Expand the advanced Panel on the left.
  7. Next to Analytics Type select Google Tags.
    Select Google Tags
  8. Build and upload your Flipbook, and then view it.

And that’s it. Your Flipbook is now running your custom javascript.

If it doesn’t work

  • The flipbook does nothing new. Tag Manager holds your tag but the container was never published — Submit and Publish the version.
  • Tag Manager is set up and still nothing runs. In the Design tab, expand the advanced panel and check Analytics Type is set to Google Tags.
  • Nothing reaches Tag Manager at all. Check the Tag Manager ID was pasted next to each domain the flipbook appears under, in Setup → Domains.