• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Download Monitor & Manager Plugin

Simple Download Monitor & Manager for WordPress

  • Home
  • Documentation
  • Addons/Extensions
  • Login
    • Sign In
    • Edit Profile
    • My Downloads
  • Support
    • Tutorials
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration
  • Contact Us
You are here: Home

smythsys

  • Profile
  • Topics Started
  • Replies Created
  • Engagements
  • Favorites

Forum Replies Created

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • July 1, 2019 at 12:17 pm in reply to: Download Hook for Analytics #1251
    smythsys
    Participant

    In case someone needs it, this worked (change event as appropiate):

    
    add_action( 'wp_footer', function () { ?>
    <script>
    document.addEventListener('click', function(e) {
        if (e.target.className == 'sdm_fancy2_download_dl_link')
        {
            gtag('event', 'descarga', { 'event_category': 'descarga', 'event_action': 'enviar',
    'event_label': 'es', 'value': '0'});
        }
    });
    </script>
    <?php } );
    
    June 20, 2019 at 8:35 pm in reply to: Download Hook for Analytics #1221
    smythsys
    Participant

    The add_action( ‘wp_footer’, function () {—–}) adds that code to the footer.
    And it is being added correctly. We see the script on the footer of the page.

    stackoverflow.com/questions/48707083/wp-footer-not-load-plugin-script-in-wordpress

    We are using this code for CF7 and it triggers the sent events.
    But we can’t find an event for the download action.
    Is there one we can use?

    But I hadn’t thought on the onclick button JS. I could use the sdm_fancy2_download_dl_link class.
    Thanks, I will try that. And add the code if it works for anyone who needs it.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)

Primary Sidebar

Featured Addons

  • Squeeze Form Addon
  • Hidden Downloads Addon
  • Amazon S3 Integration

Support Links

  • Support Forum

Search

Featured Plugin

WP Express Checkout Plugin

Start managing and tracking your file downloads with the simple download monitor plugin. Download Now

Copyright © 2025 | Simple Download Monitor | A member of the Tips and Tricks HQ family.