Ready to get started?Download WordPress


Google Analytics for WordPress
trackEvent Download - Not working on Custom Post Type (1 post)

  1. cdodge
    Posted 3 months ago #


    I'm using the plugin and everything works just fine including tracking download events throughout my site in my google analytics, however the exception seems to be a custom post type of mine.

    The links I am trying to track are downloadable PDFs that I import using a custom post type field. I then call the medias URL in my template as a link.

    I call the link as such -

    <p><b>Download PDF:</b> <a href="<?php echo $url; ?>"><?php echo the_title(); ?></a></p>

    With the resulting link -

    <p><b>Download PDF:</b> <a href="http://document.pdf">Document Title</a></p>

    I'm unsure as to why the trackEvent code is not being attached to this download link?



You must log in to post.

About this Plugin

About this Topic