WordPress.org

Ready to get started?Download WordPress

Forums

WP-Piwik
[resolved] Request - CDN Support (10 posts)

  1. trappedinside
    Member
    Posted 1 year ago #

    Not sure where to put or send this so hope ok to post here.

    The only thing for me missing from the plugin is being able to change the tracking code to use a CDN. At the moment if I want to use a CDN based tracker I still need to manually edit my template. So annoying considering that it is almost there.

    Ian

    http://wordpress.org/extend/plugins/wp-piwik/

  2. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    Can you give me some information on how you have to change your tracking code?

    Maybe this is just a little change to do. :-)

  3. trappedinside
    Member
    Posted 1 year ago #

    Hi Breaking,

    This is the code I manually put into templates.

    <!-- Piwik -->
    <script type="text/javascript">
    var _paq = _paq || [];
    (function(){ var u=(("https:" == document.location.protocol) ? "https://analytics.domain.com/" : "http://analytics.domain.com/");
    var ucdn=(("https:" == document.location.protocol) ? "https://cdn.domain.com/" : "http://cdn.domain.com/");
    _paq.push(['setSiteId', SITE_ID]);
    _paq.push(['setTrackerUrl', u+'piwik.php']);
    _paq.push(['trackPageView']);
    _paq.push(['enableLinkTracking']);
    var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0]; g.type='text/javascript'; g.defer=true; g.async=true; g.src=ucdn+'piwik.js';
    s.parentNode.insertBefore(g,s); })();
    </script>
    <!-- End Piwik Code -->

    This is Asynchronous to also help the site pages load just a little faster. Reference http://piwik.org/docs/javascript-tracking/#toc-asynchronous-tracking

    If we could just copy and paste our own tracking code it would be fine. Otherwise a additional setting page to customise the tracking where we can specify all the different hosts and regenerate code.

    I would be happy to help you test, and give you access to a CDN if you do not have one.

    Ian

  4. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    Hi Ian,

    I'm currently waiting for the Piwik team to finish a feature request, see
    http://wordpress.org/support/topic/plugin-wp-piwik-piwik-asynchronous-tracking

    Using a custom tracking code field (extended by wildcards) sounds good as a workaround. I'll think about this.

    Best regards
    André

  5. trappedinside
    Member
    Posted 1 year ago #

    Hi Andre,

    From looking at the history of that asynchronous feature request ( 2 years old now ) i would guess it could take a while before being completed.

    But anything you can do would be really appreciated.

    Ian

  6. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    Feature "custom tracking code" will be part of 0.9.9.

  7. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    CDN support is added in 0.9.9, release today.

  8. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    0.9.9.0 released now. I hope the CDN support works fine :)

  9. trappedinside
    Member
    Posted 1 year ago #

    This new version works great for me as I have a SSL certificate. However I have realised that many users will not have SSL on the CDN's as they are very expensive. If possible can you update the next version to allow for different hostnames 1 for http and 1 for https.

    For example if your CDN is with cdn77.com then your http host maybe - cdn.domain.com but your https host would be myprefix.r.worldssl.net

    Sorry I did not specify that in my earlier comments.

  10. braekling
    Member
    Plugin Author

    Posted 1 year ago #

    Alright, updated in 0.9.9.1.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.