Google Analytics without Click

This topic contains 4 replies, has 3 voices, and was last updated by  Bernward Maspohl 4 years, 1 month ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #533948

    Bernward Maspohl
    Full Member
    Post count: 65

    Hi there,

    I would love to see the Google Analyitcs statistics directly without clicking. Is that somehow possible?

    Thanks!
    Bernward

    #533958

    Guust
    Moderator
    Post count: 29970

    Do you mean that you want the Google Analytics widget to be automatically open when entering a page, without having to click “Show Google Analytics”?

    #533969

    Bernward Maspohl
    Full Member
    Post count: 65

    Yeah, right. That’s what I mean.

    #533973

    Kiran
    Moderator
    Post count: 7069

    Hi Bernward,

    Try following PHP snippet to show Google Analytics without click.

    
    
    function gd_snippet_show_google_analytics() {
    ?>
    <script type="text/javascript">
    jQuery(function($) {
    	if ($('.gdga-show-analytics').length) {
    		$('.gdga-show-analytics').trigger('click');
    	}
    });
    </script>
    <?php
    }
    add_action( 'wp_footer', 'gd_snippet_show_google_analytics', 99 );

    Kiran

    #533983

    Bernward Maspohl
    Full Member
    Post count: 65

    Hi Kiran,
    it works perfectly 🙂 Thank you very much!
    Bernward

Viewing 5 posts - 1 through 5 (of 5 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket