Support » Plugin: Google Analytics for WordPress by MonsterInsights » How to load the Google javascript for Remarketing (digital marketing)

  • Hello,

    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 |
    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’) + ‘’;

    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’) + ‘’;

    must be replaced with the modified line:
    ga.src = (‘https:’ == document.location.protocol ? ‘https://’ : ‘http://’) + ‘’;

    in order to support remarketing. See 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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Sorry, I keep meaning to say Google Analytics for WordPress, not WP SEO.

    +1 to this request 🙂

    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.

    +1 to this request.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to load the Google javascript for Remarketing (digital marketing)’ is closed to new replies.