Google Analytics by Yoast
[closed] How to load the Google javascript for Remarketing (digital marketing) (5 posts)

  1. graisee
    Posted 2 years ago #


    I haven't been able to find any reference or post regarding Google Analytic's support option for the Remarketing (Digital Marketing?). The plugin displays

    <script type="text/javascript">//<![CDATA[
    // Google Analytics for WordPress by Yoast v4.3.3 | http://yoast.com/wordpress/google-analytics/
    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-xxxxxxxx-2']);
    (function () {
    var ga = document.createElement('script');
    ga.type = 'text/javascript';
    ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(ga, s);

    Google analytics explains that the standard line:
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';

    must be replaced with the modified line:
    ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';

    in order to support remarketing. See https://support.google.com/analytics/answer/2444872?hl=en for the documentation on this.

    It doesn't matter what site this is on as I'll need to use it on almost every site going forward.

    Can someone tell me how to get this to populate correctly in WP SEO? I'm going to have to disable WP SEO and add the tracking code manually, temporarily (I hope), to accommodate this for now.

    Thank you,
    Shawn Blair


  2. graisee
    Posted 2 years ago #

    Sorry, I keep meaning to say Google Analytics for WordPress, not WP SEO.

  3. gillespieza
    Posted 2 years ago #

    +1 to this request :)

  4. lesb55
    Posted 2 years ago #

    I also just discovered Yoast's Google analytics plugin does not include any allowance to add the remarketing code.

    Pity; Yoast's plugin does add some extra functionality, and because the code is inserted dynamically it always ensures you are using the latest code.
    Otherwise you do need to check occasionally in your analytics account that your code is still current, and if not; manually update by placing the new code in your header.php.

    Those benefits are minor compared to the ecommerce benefits of using remarketing (your ad follows the customer around the web).

    Consequently; no longer using Google Analytics for WordPress.

  5. Mike Zielonka
    Posted 2 years ago #

    +1 to this request.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Google Analytics by Yoast
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic