• Hello, I am currently using AMP on my site hausa.naijanews.com with my website theme in standard mode AMP.

    I, however, observe that wp_footer(); function is not working despite it being present on my website footer.

    Because of this jetpack is not functioning well.

    How do I add wp_footer(); in standard mode AMP?

Viewing 9 replies - 16 through 24 (of 24 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    OK, here’s an important thing: the menu is not working on AMP pages in Transitional mode either.

    Try clicking the menu button on https://hausa.naijanews.com/?amp

    Note that no menu appears. It appears you need to make your mobile menu AMP-compatible. We do have some documentation about how you can do this: https://amp-wp.org/documentation/playbooks/toggling-hamburger-menus/

    If you do go Standard mode, you’ld also be able to make use of the amp-sidebar component instead of the sidebar code you’re currently using.

    Thread Starter opeedo

    (@opeedo)

    Alright, i’d look up the links you sent to me, I, however, reached out to the theme support and I was told the sidebar was not working because AMP does not support javascript.

    Secondly i’d like to ask can the sidebar not working kill the jetpack stat?

    Plugin Author Weston Ruter

    (@westonruter)

    AMP does allow JavaScript, but with constraints. You can use AMP components which are JavaScript. You can use some scripting with amp-bind and even full encapsulated JavaScript in amp-script.

    The theory for why the stats go down when in AMP because the sidebar isn’t working. So I’d say fix the sidebar, and then try switching back to Standard mode and see if you still see a drop.

    Thread Starter opeedo

    (@opeedo)

    I see that this issue is beyond the sidebar, The Sidebar is in the body and has nothinng to do with the footer where jetpact pixel his, my Footer does not appear broken and other codes including Google Analytics and others are working perfectly from my footer.
    The issue is with Jetpack stat I see someone raising an issue Here also.

    And I see you’ve raised a Github,can you help talk to Jetpack to have this issue resolved ASAP?

    Plugin Author Weston Ruter

    (@westonruter)

    The thinking is that if the sidebar is broken, users would not be able to navigate around the site on AMP, and this could reduce the amount of traffic for AMP visitors. That’s how this relates to the sidebar.

    The issue I raised is not regarding tracking page views but tracking outbound link clicks.

    Thread Starter opeedo

    (@opeedo)

    No, I want the site fully in standard mode, no separate AMP page.
    The beauty of this is after going through this trouble successfully this resource would be available for everyone to use.

    Meanwhile, I just discovered the two javascript below are being blocked in AMP. That is why AMP is unable to measure stat in standard mode.

    <script type='text/javascript' src='{$script}' async='async' defer='defer'></script>
    <script type='text/javascript'>
    	_stq = window._stq || [];
    	_stq.push([ 'view', {{$data_stats_array}} ]);
    	_stq.push([ 'clickTrackerInit', '{$data['blog']}', '{$data['post']}' ]);
    </script>

    The scripts are located stats.php in jetpack plugin

    Plugin Author Weston Ruter

    (@westonruter)

    No, I want the site fully in standard mode, no separate AMP page.

    I don’t think you understand what I meant. The mobile nav menu is not currently working on your AMP pages. Clicking the menu does nothing other than make the menu button disappear. This broken nav menu is one idea for why you’re seeing less traffic on your AMP pages than non-AMP pages.

    Meanwhile, I just discovered the two javascript below are being blocked in AMP. That is why AMP is unable to measure stat in standard mode.

    This is not blocked, but rather Jetpack is not outputting it in the first place on AMP pages. See https://github.com/Automattic/jetpack/blob/aaa09893e280259c2a9409eac8a12ee42ecd3da2/modules/stats.php#L243-L267

    Note the view stat is currently being tracked via amp-pixel here: https://github.com/Automattic/jetpack/blob/aaa09893e280259c2a9409eac8a12ee42ecd3da2/modules/stats.php#L269-L279

    The clickTrackerInit is not currently being tracked. This is the outbound link tracking issue that you already discovered: https://github.com/Automattic/jetpack/issues/17172

    My understanding was that you were seeing a reduction in pageviews, not outbound link clicks.

    Thread Starter opeedo

    (@opeedo)

    The thinking is that if the sidebar is broken, users would not be able to navigate around the site on AMP, and this could reduce the amount of traffic for AMP visitors.

    No, this does not actually affect traffic much since most of these visitors come in via Google Search, the interestingly weird thing is when I switch to AMP Standard Mode Jetpack stops recording inbound traffic details completely as if no one is coming in from Search.

    Plugin Author Weston Ruter

    (@westonruter)

    Have you considered adding a secondary analytics service to double check the results? If Google Analytics continues to report the same expected traffic on Standard mode but Jetpack does not, then they would be a helpful indication that the problem is indeed with Jetpack Stats.

Viewing 9 replies - 16 through 24 (of 24 total)
  • The topic ‘wp_footer(); Not working in your standard mode AMP’ is closed to new replies.