Code Monkey home page Code Monkey logo

google-analytics-for-wordpress's Introduction

=== MonsterInsights - Google Analytics Dashboard for WordPress (Website Stats Made Easy) ===
Contributors: chriscct7, smub
Donate link: http://www.wpbeginner.com/wpbeginner-needs-your-help/
Tags: WordPress analytics, google analytics, google analytics dashboard, google analytics widget, Website Analytics
Requires at least: 5.6.0
Tested up to: 6.5.2
Stable tag: 8.28.0
Requires PHP: 7.2
License: GPL v3

The best free Google Analytics plugin for WordPress. See how visitors find and use your website so you can grow your business with powerful analytics.

== Description ==

= Google Analytics Plugin for WordPress =

With over 3 million active installs, MonsterInsights is the most popular Google Analytics plugin for WordPress.

We believe that it's easy to double your traffic and sales when you know exactly how people find and use your website. [MonsterInsights](https://www.monsterinsights.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion) shows you the analytics and stats that matter, so you can grow your business with confidence.

At MonsterInsights, we make it "effortless" to properly connect your WordPress site with Google Analytics, so you can start making data-driven decisions to grow your business.

Unlike other Google Analytics plugins, MonsterInsights allows you to enable all advanced Google Analytics tracking features with just a few clicks (no need to hire a developer).

The best part is that MonsterInsights comes with an analytics dashboard for WordPress that shows you actionable analytics reports right inside your WordPress dashboard. We have created customized reports that eliminate the fluff and only show you the stats that matter, so you can see exactly what's working and what's not!

Simply put, MonsterInsights is the most complete Google Analytics plugin for WordPress that's both EASY and POWERFUL.

That's why millions of small businesses and top companies like Microsoft, Bloomberg, FedEx, Yelp, Subway, etc. use MonsterInsights to setup Google Analytics on their WordPress sites.

> <strong>MonsterInsights Pro</strong><br />
> This plugin is the lite version of MonsterInsights Pro plugin that comes with all the tracking features you will ever need including events tracking, ecommerce tracking, custom dimensions tracking, page speed reports, popular post tracking, custom dimensions, affiliate link tracking, video tracking and tons more. [Click here to purchase the best premium Google Analytics plugin for WordPress now!](https://www.monsterinsights.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion)

We took the pain out of installing Google Analytics in WordPress and made it easy. Here's why over 3 million smart business owners, designers, and developers love MonsterInsights, and you will too!

https://www.youtube.com/watch?v=4Y8TGGkdcGY

= Quick & Easy Google Analytics Setup =

Properly setting up Google Analytics is complicated. You have to either hire a developer or learn how to add advanced code snippets to your website in many different areas. This process can take days or weeks...and can even break your website!

With MonsterInsights, we made it "effortless" to properly setup Google Analytics in WordPress. Yes, you can enable all advanced Google Analytics features with just a few clicks.

If you can point-and-click, then you can set up Google Analytics inside WordPress and start seeing insights in under 15 minutes (no code necessary).

See what one business owner is saying about MonsterInsights:

>It just works. Really easy way to insert Google Analytics tracking code and keep it there when switching themes. No need to copy/paste code anywhere. This is the best way to handle Google Analytics in WordPress.<br>
> Steven Gliebe

= Google Analytics Dashboard =
Our goal at MonsterInsights is to make Google Analytics easy and accessible for everyone.

We understand that Google Analytics has a steep learning curve. That's why MonsterInsights comes with a built-in Google Analytics Dashboard for your WordPress site, so you can see all the useful information about your visitors right inside your WordPress dashboard.

We have even created customized reports to help you filter through the noise and see the stats that really matter!

* **Audience Report** shows you detailed insights like which country your visitors are coming from, what are they most interested in, which device are they using, their age, gender, and more. 

* **Publishers Report** helps you understand which pages your visitors are arriving, and which pages they are leaving from. Designed specifically for blogs and other resource sites, this powerful report will show you which outbound links are getting clicked so you can easily optimize for higher conversions.

* **Content Report** shows you stats on exactly which content gets the most visits, so you can stop guessing and start creating content that gets more traffic and conversion.

* **Ecommerce Report** shows you important store stats like total revenue, conversion rate, average order value, top referral sources, and more (all in one place).

* **Forms Report** shows you conversion stats for various contact forms and lead forms on your website, so you can improve the conversions to grow your business.

* **Search Console Report** shows you exactly how well your website is ranking in Google, so you can further optimize your SEO to grow your organic traffic.

* **Custom Dimensions Report** helps you dig deeper by showing you useful stats like who are your most popular authors, what are the best publication times, which are your most popular categories or tags, how well are your Yoast focus keywords and SEO score performing, and more.

* **Site Speed Report** makes it easy to track pagespeed insights and loading times for your website and get the information you need to improve user experience and your SEO rankings.

* **Landing Page Report** instantly shows you which pages need to be optimized to increase engagement and help you make more money without needing to log into Google Analytics.

* **Source and Medium Report** gives you an easy view of Google Analytics UTM tracking to see where you traffic comes from.

* **Technology Report** shows you which devices and browsers visit your website, so you can optimize for each visitor. 

* **Campaign Report** easily unlocks all of your Google Analytics UTM tracking to show you how effective your marketing efforts have been. 

* **Pages Report** shows you which pages are most poplular on your website, and shows impressive metrics like bounce rate, engaged sessions to help you optimize.

* **Coupon Report** showcases your coupon usage, and shows important metrics like average order value and revenue.

* **Funnel Report** visually shows you how many people view items in your store, add to cart, and make a purchase. You can easily breakdown the funnel and conversion report into channel, and customize your dates for in depth analysis. 

Our custom Google Analytics Dashboard reports are based on over 12+ years of online business experience. We built MonsterInsights to be the Google Analytics plugin that we wish we had.

We currently use MonsterInsights on all our portfolio companies which include both media sites generating tens of millions of pageviews and eCommerce sites generating millions in sales.

>I love being able to drill down into the analytics via the reporting feature. I have the PRO version and it makes a big difference what you can analyze. I'm glad that I can integrate with Pretty Links too!<br>
>Kim Beasley - MonsterInsights user

Simply put, MonsterInsights allow you to take full advantage of all the powerful Google Analytics features.

After reading this exhaustive feature list, you can probably imagine why MonsterInsights is the best Google Analytics plugin for WordPress.

Give MonsterInsights a try.

= Credits =

This plugin is created by [Chris Christoff](https://twitter.com/chriscct7) and [Syed Balkhi](https://syedbalkhi.com) with sponsorship from [WPBeginner](http://www.wpbeginner.com).

= Branding Guidelines =

MonsterInsights&reg; is a registered trademark of MonsterInsights LLC. When writing about the Google Analytics for WordPress plugin by MonsterInsights, please make sure to uppercase the first letters of both word.

* MonsterInsights (correct)
* Monster Insights (incorrect)
* monsterinsights (incorrect)
* monsterinsight (incorrect)

== Installation ==

1. Install Google Analytics for WordPress by MonsterInsights either via the WordPress.org plugin repository or by uploading the files to your server. (See instructions on <a href="http://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/" rel="friend">how to install a WordPress plugin</a>)
2. Activate Google Analytics for WordPress by MonsterInsights.
3. Navigate to the Insights tab in your WordPress admin menu and configure the plugin.
4. Want more features? <a href="https://www.monsterinsights.com/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion">Purchase MonsterInsights Pro</a>!

== Changelog ==
= 8.28.0: July 08, 2024 =
-New: Date Comparisons - Now you can easily compare your stats on any chart or graph.
-Enhancement: We updated tooltips to make it easier to understand some options.

= 8.27.0: May 29, 2024 =
- New: Site Notes Automations addon. 
- Fix: We fixed an issue related to eCommerce abandoned checkouts.
- Fix: We fixed an issue related to UserJourney report pages.
- Enhancement: We improved the notification system.

= 8.26.0: April 16, 2024 =
- New: Added new Exceptions Report
- New: Added new Google Consent support.
- Enhancement: We improved the country list in the Funnel Report.
- Fix: We solved an issue occurring in the plugin onboarding process.
- Fix: We solved a style issue related to abandoned checkouts in reports.

= 8.25.0: March 05, 2024 =
- Enhancement: Improved Site Speed report.
- Fix: We solved an issue related to flag icons.
- Fix: We solved some JavaScript errors occurring with third-party plugins.

= 8.24.0: February 19, 2024 =
- New: Site Insights Gutenberg block. Easily share website stats with your visitors.
- New: PrivacyGuard Feature - Proactively block PII (Personally Identifiable Information) from ever making it to Google Analytics
- New: EEA Checker tool for Google Ads / Analytics Requirements
- Fix: We solved an issue occurring in the Weekly/Monthly Email reports.
- Fix: We solved an issue occurring with Popular Posts.
- Fix: We solved an issue occurring with Tracking Video Title in Divi theme.

= 8.23.1: December 18, 2023 =
- Fix: We fixed an issue related to All in One SEO plugin.

= 8.23.0: December 14, 2023 =
- New: Our Year In Review report is here. This report will automatically show up starting in January 1 until Jan 14 2024.
- Fix: We fixed an issue occurring with Site Notes.
- Fix: We fixed minor issues in the Gutenberg blocks.
- Fix: We added support for WooCommerce custom order status.

= 8.22.0: November 29, 2023 =
- Enhancement: Improved Social Media report.
- Fix: We fixed the View More link in the Email Summaries.
- Fix: We fixed a Vue warning in Site Notes.
- Fix: We fixed the sporadic Error 429 from Google Analytics API.
- Fix: We fixed a duplicate error message in the Setup Checklist.

= 8.21.0: November 13, 2023 =
- New: Social Media report.
- New: Exclude query parameters from GA4 data stream.
- Enhancement: Improved compatibility towards WordPress 6.4.1.
- Fix: We fixed an issue that occurred with Pretty Links.

= 8.20.2: November 01, 2023 =
- Fix: Popular posts, we fixed a bug occurring in curated popular posts.

= 8.20.1: October 09, 2023 =
- Fix: We updated our lite emails to render better inside multiple mail clients. We also changed the emails to send out monthly instead of weekly. To disable emails go to Settings -> Advanced - Toggle the "Enable Email Summaries.

= 8.20: October 03, 2023 =
- New: Google Analytics and eCommerce support for WishList Member
- New: Google Analytics and eCommerce support for WPCharitable 
- Enhanced: Improved support for PHP 8.2.
- Enhanced: Improved Site Health compatibility.
- Fixed: Restrict Content Pro, we fixed the refund event in GoogleAnalytics when order status is failed or abandoned.
- Fixed: We fixed some minor bugs related to notifications. 
- Fixed: Popular posts, we fixed a bug occurring in curated popular posts.
- Fixed: We fixed some minor bugs related to User Journey.

= 8.19: August 23, 2023 =
- New: Ecommerce funnel report for WooCommerce and Easy Digital Downloads.
- New: Setup checklist to get up and running faster
- Enhanced: Improved support for PHP 8.2.
- Fixed: We fixed a bug that occurred with Yoast SEO Scores.
- Fixed: We fixed a bug in the Pretty Links integration.

= 8.18: July 24, 2023 =
- New: Added 6 Completely New Pro Reports to bring the power of Google Analytics into your WordPress dashboard.
- Fixed: We fixed an issue that prevented tracking with WPML.
- Fixed: We fixed an issue that prevented tracking the User Journey with MemberPress.

= 8.17: June 29, 2023 =
- Updated: Removed dual tracking panel and limit reporting to GA4 only properties.
- Fixed: We fixed a bug in the WPForms integration.
- Fixed: We fixed a bug in the AffiliateWP integration.

= 8.16: June 19, 2023 =
- New: User Journey report now available! See all of your website's purchases in one screen. 
- Update: We updated the Popular Posts to support themes that allow widgets. 
- Fixed: We fixed some layout issues in exported PDF reports.
- Fixed: We fixed the deprecated YOAST function WPSEO_Utils::translate_score().
- Fixed: We fixed a bug occurring while downloading files having the file download tracking enabled.

= 8.15: May 03, 2023 =
- New: Site Notes allows you to record important website events right inside your WordPress dashboard.
- Update: Fix EDD integration.
- Update: Mobile screen optimizations.

= 8.14.1: Apr 11, 2023 =
- Fixed: We fixed a PHP warning error and added additional security hardening.

= 8.14.0: Mar 29, 2023 =
- New: Our New PPC Tracking addon allows you to effortlessly track sales inside Google Ads, Microsoft Ads, and Meta.
- Enhancement: We updated and tweaked lots elements to make our dashboard easier to use


= 8.13.1: Mar 14, 2023 =
- Fixed: We fixed a bug that could cause an issue if Google's API endpoint returned a non-200 response.

= 8.13.0: Mar 13, 2023 =
- Enhancement: We enhanced the notifications user experience.
- Fixed: We fixed the PDF reports header.
- Update: We applied additional security hardening.

= 8.12.1: Jan 12, 2023 =
- Fix: We made updates to authentication

= 8.12.0: Jan 12, 2023 =
- Enhancement: We updated and fixed some UI/UX elements to make MonsterInsights easier to use
- Enhancement: We optimized our Javascript code to work better with minification plugins
- Enhancement: We optimized our code to work better with PHP8

**See our [changelog](https://www.monsterinsights.com/changelog?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion) for previous releases.**

== Frequently Asked Questions ==

For all frequently asked questions, and their answers, check the [MonsterInsights Docs](https://www.monsterinsights.com/docs/).

= Why use Google Analytics vs WordPress stats? =

Native WordPress stats plugins will always slow down your website because they rely on your WordPress hosting server. Most of them do not provide accurate WordPress analytics either.

Some WordPress stats plugins use third-party servers to mitigate this issue, but they all lack powerful features that Google Analytics can offer.

Google Analytics is the #1 analytics solution in the world. It comes with all the powerful features that you can ever ask for. MonsterInsights makes it easy for you to use all advanced Google Analytics features in WordPress.

= Why choose Google Analytics by MonsterInsights vs Google Site Kit? =

The MonsterInsights Google Analytics plugin is built for all types of websites, large or small, to get up and running quickly with Google Analytics and Google Analytics 4.

Beyond simply providing a Google Analytics dashboard, our plugin makes configuring advanced features as easy as point-and-click that would otherwise still require a developer to implement.

Our Google Analytics plugin also includes many features such as Google Ads tracking, Google Optimize support, form conversion reporting, goal tracking, Search Console integration, Pagespeed insights, advanced eCommerce tracking, and more.

There's a reason over 3 million users have trusted MonsterInsights to provide Google Analytics data to their website.

= Can I use MonsterInsights together with another Google Analytics plugin? =

No. You should only use one Google Analytics plugin on your WordPress site. If you use multiple Google Analytics plugins, then you will compromise your data integrity.

We recommend uninstalling other Google Analytics plugins before you install MonsterInsights.

= Why does MonsterInsights load Google Analytics in WordPress header section? =

Some people believe that loading Google Analytics in WordPress header will slow down your website. That's a myth. The Analytics code loads asynchronously which means that it does not impact your website speed at all.

MonsterInsights loads code in WordPress header because it makes sure that you have the most accurate tracking.

= Does MonsterInsights work with ad blockers? =
As of version 7.18, Pro users of MontersInsights can use a locally hosted version of Google Analytics (gtag) which helps with tracking data accuracy. This version can also improve the performance of your website, compared to hosting the script on Google Analytics servers.

= Can I hide Google Analytics from tracking Administrators and Editors? =
Yes. By default we do not send data to Google Analytics for logged-in WordPress administrators and editors. You can add easily [block additional user roles](<https://www.monsterinsights.com/docs/exclude-user-roles-from-google-analytics-tracking).

= How does MonsterInsights help with Google Analytics GDPR compliance? =
MonsterInsights helps make Google Analytics GDPR compliance easier for business owners.

Our EU compliance addon allows you to:

* Anonymize IPs to Google Analytics
* Disable the Demographics and Interest Reports for Remarketing and Advertising
* Disable UserID and author name tracking
* Integrate with Cookie Notice and CookieBot plugins to collect user consent before tracking
* Integrate with Google AMP Consent Box before enable tracking
* Integrate with Google Analytics Chrome browser opt-out extension and built-in cookie opt-out system
* Offer Easy Opt Out link for Google Analytics tracking

While no single plugin can guarantee 100% GDPR compliance in WordPress, MonsterInsights goes to great lengths in helping business owners with GDPR compliance.

For more details, see: <a href="https://www.monsterinsights.com/gdpr-and-monsterinsights-everything-you-need-to-know/" rel="friend">GDPR and MonsterInsights - Everything You Need to Know</a>.

= Which eCommerce plugins are compatible with MonsterInsights Enhanced Ecommerce Tracking feature? =

If you are looking to enable Google Analytics Ecommerce tracking in WordPress, then MonsterInsights is the best solution to do that.

With just 1-click, you can enable Google Analytics Enhanced Ecommerce Tracking for WooCommerce and see WooCommerce analytics report right inside your WordPress dashboard.

MonsterInsights Enhanced eCommerce tracking works out of the box with WooCommerce, Easy Digital Downloads, MemberPress and 10+ other advanced integrations. These include:

* **Yoast SEO** - Easily view and analyze YoastSEO scores directly inside Google Analytics with custom dimensions.
* **Gravity Forms, Formidable Forms, Contact Forms 7** - View form events and conversion statistics.
* **LifterLMS** - Track sales data inside Google Analytics.
* **GiveWP** - Track donations as eCommerce events inside Google Analytics.
* **Restrict Content Pro** -  View Google Analytics eCommerce data.
* **WordPress Comment Forms** - See which articles are driving the most engagement inside Google Analytics.
* **Generic Forms** - Easily add Google Analytics conversion tracking data to your website, no coding needed for all types of forms.

= Does MonsterInsights work on WordPress multisite? =

Yes. MonsterInsights offers the most comprehensive Google Analytics solution for WordPress multi-site.

It comes with advanced permission control, sample rate control, and other options that you need to properly enable Google Analytics on WordPress multisite.

= Does MonsterInsights support Google Analytics v4 (GAv4) =

Yes, we fully support Google Analytics v4 (GAv4) properties as well as GAv3 (Universal) properties. In fact, you can track your site to both at the same time using [our exclusive dual tracking feature](https://www.monsterinsights.com/introducing-google-analytics-4-dual-analytics-tracking-for-wordpress/?utm_source=wprepo&utm_medium=link&utm_campaign=liteversion).


== Screenshots ==

1. The overview report
2. Top countries and referrals
3. Top posts and pages
4. Authentication with MonsterInsights
5. Settings page
6. File download tracking
7. eCommerce tracking - no configuration required (Pro feature)
8. eCommerce report (Pro feature)
9. Search console report (Pro feature)
10. Custom dimensions tracking (Pro feature)
11. Custom Dimensions report (Pro feature)

google-analytics-for-wordpress's People

Contributors

andyle2010 avatar atimmer avatar barrykooij avatar cfoellmann avatar chriscct7 avatar ciprianimike avatar dkd903 avatar garyjones avatar jjeaton avatar jmslbam avatar joshk avatar jrfnl avatar mircian avatar nerrad avatar omarreiss avatar rarst avatar serdarozturk avatar tacoverdo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-analytics-for-wordpress's Issues

Bug: Settings on multisite

Settings on WP multisite subsites revert back to the main blog's GA settings on page refresh (when using authentication AND when updating settings). This ultimately makes it impossible to set up GA on subsites. Tested on 2 separate WP4.0 multisites.

Hello I was getting an error

Notice: Undefined index: anonymize_ips in /wp-content/plugins/google-analytics-for-wordpress/frontend/class-ga-js.php on line 79

Notice: Undefined index: debug_mode in /wp-content/plugins/google-analytics-for-wordpress/frontend/class-ga-js.php on line 114

Fixed by adding
if ( isset($options['anonymize_ips']) && $options['anonymize_ips'] == 1 ) {
and
if ( isset($options['debug_mode']) && $options['debug_mode'] == 1 ) {

respectively this is in the update released today, hope it helps, sorry this isn't a pull request

A/B Testing

Google Analytics has some powerful A/B Testing features built in. But it requires a bit of effort on the website-end.

Since Google Analytics for WordPress already has the account info, it would be great to have this additional feature...

Universal Tracking?

Are there plans to add the "new" universal tracking?
As an option or replacing the classic tracking? Maybe it is possible to get the mode (classic vs universal) from the API and only let the use select the right property/tracking-mode combination

Is A New Top Level Menu Really Necessary?

Hey guys... first of all, great work on the plugin update. I've been looking forward to switching over some sites to Universal for quite a while. I do have one gripe though. Does an analytics plugin really need a top level menu item right under the dashboard? It seems a little excessive to me.

Couldn't you just as easily move the extensions portion within the main settings page and the "Dashboard" piece as a submenu of the dashboard menu? Please don't force us to have yet another top level admin menu in our dashboard... it's starting to get painful with so many plugins going this route.

Adding Page URL as a 'label' for outbound links (internal links to track as outbound)

Hello Yoast team,

Is it possible to add current page URL as a 'label' for outbound links like /refer/ or /out/

For example

<a rel="nofollow" href="http://www.example.com/refer/exampleaff/" onclick="javascript:_gaq.push(['_trackEvent','outbound-article-aff','/refer/exampleaff/','http://urlofcurrentpage/']);" title="InMotion web hosting" target="_blank">Anchor Text</a>

So that we can get exact number about which article getting more affiliate clicks etc. I've checked the source and found that we're not using 'label' field in a code.

Regards,
Rajesh

Settings API + tabs

I think the UI and thereby the overall UX of the settings page can be improved by:

  1. remove metaboxes + creation of options with the Settings API
  • more natural UI like on core settings pages
  • less maintenance because design follows core design
  • Settings API: allows to "inject" settings externally without the need for custom hooks
  1. use tabs to split up settings (now achieved with the metaboxes)

Fix capability so admins on sites in a network have access to settings

When the plugin is activated on a single site in a network, site admins cant access the plugin settings. The capability you've set is too restrictive. To fix this, in /admin/yst_plugin_tools.php, change line 16 from:

var $accesslvl = 'edit_users';

to:

var $accesslvl = 'manage_options';

Undefined Index warnings

I got these two warnings

Notice: Undefined index: anonymize_ips in /home/somethum/public_html/lpslaw/wp-content/plugins/google-analytics-for-wordpress/frontend/class-ga-js.php on line 71

Notice: Undefined index: debug_mode in /home/somethum/public_html/lpslaw/wp-content/plugins/google-analytics-for-wordpress/frontend/class-ga-js.php on line 106

Issue with update 5.0.2. It re-writes my a tags and removes details

It seems to remove the classes from my html when activated on version 5.0.2

I've tried to shut off tracking on the General tab on the plugin, it doesn't help.

The Top image is what it should look like, and the bottom image is what it looks like with the plugin activated. I'm on 5.0.2

good code
bad-code

Issues on local dev environment while 'Track outbound clicks & downloads' is active

This isn't so much an issue I need help with, more so a bug report for some strange behaviour I've come across while developing locally.

While filtering the content I found that an image with a local path, wrapped in an achor tag, causes the resulting quotation marks around the anchor href attribute to change (i.e. one is single, the other is double), causing the resulting markup to fail. This only seems to happen under the following conditions;

  • the anchor tag href is wrapped in single quotes
  • the image has a local file path
  • the Track outbound clicks & downloads: is checked

I realise this could be avoided by just using double quotes, but I find the resulting PHP can become rather verbose with some many quotes. I prefer to use cleaner syntax, as per the following example;

echo "<a href='{$href}'></a>";

Note: If I disable the Track outbound clicks & downloads: option, things work as they should.

// These don't work
$content .= "<a href='#'><img src='http://192.168.1.111/rocketboypizza.com/wp-content/themes/pds-child-rocketboy/assets/images/box-order-online.png' width='158' height='160' /></a>";
$content .= "<a href='#anchor'><img src='http://192.168.1.111/rocketboypizza.com/wp-content/themes/pds-child-rocketboy/assets/images/box-order-online.png' width='158' height='160' /></a>";

// These Work
$content .= '<a href="#"><img src="http://192.168.1.111/rocketboypizza.com/wp-content/themes/pds-child-rocketboy/assets/images/box-order-online.png" width="158" height="160" /></a>';
$content .= "<a href='http://asdfasdf.com'><img src='http://192.168.1.111/rocketboypizza.com/wp-content/themes/pds-child-rocketboy/assets/images/box-order-online.png' width='158' height='160' /></a>";
$content .= "<a href='#'><img src='/wp-content/themes/pds-child-rocketboy/assets/images/box-order-online.png' width='158' height='160' /></a>";
$content .= "<a href='#'>Text Link</a>";

Resulting markup;

<a href="#'><img src='http://192.168.1.111/rocketboypizza.com/wp-content/themes/pds-child-rocketboy/assets/images/box-order-online.png" width="158" height="160"></a>
<a href="#anchor'><img src='http://192.168.1.111/rocketboypizza.com/wp-content/themes/pds-child-rocketboy/assets/images/box-order-online.png" width="158" height="160"></a>

<a href="#"><img src="http://192.168.1.111/rocketboypizza.com/wp-content/themes/pds-child-rocketboy/assets/images/box-order-online.png" width="158" height="160"></a>
<a href="http://asdfasdf.com" onclick="javascript:_gaq.push(['_trackEvent','outbound-article','http://asdfasdf.com']);"><img src="http://192.168.1.111/rocketboypizza.com/wp-content/themes/pds-child-rocketboy/assets/images/box-order-online.png" width="158" height="160"></a>
<a href="#"><img src="/wp-content/themes/pds-child-rocketboy/assets/images/box-order-online.png" width="158" height="160"></a>
<a href="#">Text Link</a>

Admin not rendering correctly

Hey Yoast team

The admin area does not seem to be rendering correctly, please see the attached images of the issue. I've disabled all plugins

1
1a

2

Filter to deactivate yoast_tracking and pointer

There really should be a filter like this:
apply_filters( 'yoast-ga-allow-tracking', true )
to (dis)allow yoast_tracking before activating the plugin.

I am sure its nothing you really want to integrate but I get a lot issues from users not knowing what to do with this. It is really confusing for users since the plugin itself is for "tracking".

Options for GA and/or UA codes

Hello!

There does not seem to be a way to insert the (relatively) new Universal Analytics code (function(i,s,o,g,r,a,m)... blah blah blah) instead of or in addition to the older version (var _gaq=blah blah blah). My company is currently implementing both on client sites for enhanced link attribution tracking, since it is not yet supported in UA. If this functionality does not yet exist, could it be a consideration for the future?

Thanks so much!
Jenni Brush

Tag Manager

Google Analytics is great, but some of us use multiple Google services - GWT, GA, AW, etc.

Google provides a Tag Manager service to pull all of these together.

Would be nice if Google Analytics for WordPress supported Google Tag Manager tags in addition to merely GA tags.

Google Authentication not working

This is the error I get if I try to authenticate via Google account in v5.0.2

Warning: Cannot unset offset in a non-array variable in /home3/nspeaksc/public_html/nspeaks   /wp-content/plugins/google-analytics-for-wordpress/admin/class-admin.php on line 584

Warning: Cannot modify header information - headers already sent by (output started at /home3/nspeaksc/public_html/nspeaks/wp-content/plugins/google-analytics-for-wordpress/admin/class-admin.php:584) in /home3/nspeaksc/public_html/nspeaks/wp-includes/pluggable.php on line 1121

Custom code output below trackPageview

Hi, I installed the Yoast Google Analytics WordPress Plugin and placed the following line of js in the 'custom code' section: ga('require', 'linkid', 'linkid.js');

On the admin page, under the 'custom code' section, it says "this allows you to add a line of code, to be added before the trackPageview call.", but when I view the code it's placed AFTER the trackPageview call.

Manual code not working

Running 4.3.3. Seems to be a small bug in this version when manually entering the UA code (I do not believe it was an issue in 4.3.2).

Once you check the box, the field beneath does not unhide itself to allow for manually entering the code.
screen shot 2013-11-15 at 12 02 15 pm

I'm able to unhide the field with Inspector and enter it and that works fine. I believe it's just a small javascript bug.

Thanks!

New analytics code

Hi,
I've installed the 'Google Analytics for wordpress' on my wordpress site.
In the 'view source' I see the following code. It seems to me that this is the older version of Google Analytics code (due to the ga.js).
The second piece of code is the new version of the Google Analytics code which google says is preferable because it has some updated recording info.
So my question is whether the plugin for wordpress will get updated with the new GA code? Or - how can I update the GA code manually on my site?
Thanks!

Existing GA code currently on my wordpress website:
<script type="text/javascript">//<![CDATA[
// Google Analytics for WordPress by Yoast v4.3.5 | http://yoast.com/wordpress/google-analytics/
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-XXXXXXXX-X']);
_gaq.push(['_setCustomVar',2,'author','vijay-padhariya',3],['_trackPageview']);
(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);
        })();
        //]]></script>

New GA code as published by Google:

<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-XXXXXXXX-X', 'website.com'); ga('send', 'pageview'); </script>

Can't change to new Analytic code - keeps reverting

I changed the analytics tracking code to a new one, and it will not stick. When I save it shows the new code, but within a few minutes it reverts to the old code.

I have tried Manual and also authenticating via GA profile, both seem to work at the time, but quickly reverts, pushing the old code into the manual box.

Undefined indexes

Since the last version, the plugin throws 2 notices for an undefined index:

Notice: Undefined index: anonymize_ips in /frontend/class-ga-js.php on line 71 
Notice: Undefined index: debug_mode in /frontend/class-ga-js.php on line 106 

Hope it's helpful

Custom Variables with un-escaped characters break tracking across an entire page.

customVars with quotes or slashes in the string need to have those characters properly escaped so they can be sent to Google Analytics without breaking the tracking code. This can be a serious problem if titles or category names are being sent that contain those characters (most commonly, if they contain an apostrophe). As far as I can tell, the current str_clean function is not sufficient for this situation.

Without this change, the characters can appear un-escaped and potentially break tracking on the entire page.

I wrote a little more about this issue at http://stackoverflow.com/questions/21686260/should-i-be-using-html-entity-decode-to-escape-a-google-analytics-custom-variabl

'Demographics and Interest Reports' in Google Analytics

In order to get the Demographics (Age/Gender) and Interests (Affinity Categories) to work, Google Analytics is telling me that Tracking code changes are needed.

GA says: "Your Analytics tracking code does not include the necessary support for the Demographics and Interest reports. Learn more about the simple, one-line, one-time change to your tracking code to add this support. https://support.google.com/analytics/answer/2444872?hl=en&utm_id=ad "

The instructions state that I should change this line from:

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

To:

ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';

Does the Yoast GA for WordPress plugin support the new Demographics and Interests reports in Google Analytics?

What should I do to allow this to work using your plugin?

Conflict with Fancybox

One of my clients pointed out that the thumbs on her post excerpts on the home page at www.kimnovakartist.com were not popping up enlarged versions as they had been, using the Fancybox for WordPress plugin. After deactivating all plugins and reactivating one by one I found it was (and much to my surprise) the Google Analytics for WordPress by Yoast plugin that was causing the conflict. Thinking that installing another Fancybox plugin might get around that, I did so (Easy Fancy box this time), and sure enough, the Fancybox feature still did not work.

This nature of the misbehaving Fancy box seemed strange: it still worked on all pages, and on the category archive page for "Browse Available Paintings", but on the home page, which is essentially the same as the aforementioned category archive, and on all the individual posts, it did not work. Here's a list of all installed plugins with versions and activation status at the time the issue began:

AddThis Follow Widget Version 1.2.6
AddThis Social Bookmarking Widget Version 3.5.10
Akismet Version 3.0.2
Anti-Malware by ELI Version 3.14.24
BulletProof Security (this was disabled at the time this issue arose) Version .50.8
Easy FancyBox (newly installed and now active - also didn't work when Yoast GA was active) Version 1.5.6
FancyBox for WordPress (this is the one that was originally affected by this issue, I'll leave it for now but will delete it when no longer needed for troubleshooting) Version 3.0.2
Google Analytics by Yoast Version 5.0.5
Jetpack by WordPress.com Version 3.1.1
Select NK Google Analytics Version 1.3.5 (installed temporarily AFTER learning Yoast GA needed to be deactivated)
Simple Anti Bot Registration Engine (SABRE) Version 1.2.2
Thin Out Revisions Version 1.7 (active at tht eime of the issue occurring, now deactivated)
UpdraftPlus - Backup/Restore Version 1.9.19
Use Google Libraries Version 1.6.1
WordPress SEO Version 1.5.6
WP Remote

Thanks so much for looking into this! I'd love to get rid of the other Google Analytics plugin I temporarily installed as soon as possible; I like yours better, but it's important for Fancybox to work on this site.
Hannah

Regex in class GA_Filter::the_content incorrect

Look at frontend/class_frontend.php, line #429. You have the following regex:

static $anchorPattern = '/<a (.*?)href=[\'\"](.*?)\/\/([^\'\"]+?)[\'\"](.*?)>(.*?)<\/a>/i';

You are looking for anchor tags and pulling out the href parameter. The problem is that you are looking for an "href=" tag, followed by anything, followed by two forward-slashes.

I have the following HTML in my content:

<a href="#">Some Link</a><form action="http://www.something.com"></form><a href="#">Some other link</a>

Your regex is greedy so it sees the

<a href=" 

tag and then it matches everything up to the "http://" in the

form

tag. The following test case demonstrates the issue:

<?php

static $anchorPattern = '/<a (.*?)href=[\'\"](.*?)\/\/([^\'\"]+?)[\'\"](.*?)>(.*?)<\/a>/i';

$text = '<a href="#">Some Link</a><form action="http://www.something.com"></form><a href="#">Some other link</a>';
preg_match($anchorPattern, $text, $matches);
var_dump($matches);

output:

array(6) {
  [0]=>
  string(103) "<a href="#">Some Link</a><form action="http://www.something.com"></form><a href="#">Some other link</a>"
  [1]=>
  string(0) ""
  [2]=>
  string(35) "#">Some Link</a><form action="http:"
  [3]=>
  string(17) "www.something.com"
  [4]=>
  string(0) ""
  [5]=>
  string(34) "</form><a href="#">Some other link"
}

The regex is matching the entire line of HTML and is parsing out the href parameter incorrectly. I think your regex needs to specifically look for http(s)?:// in the href. This would allow it to skip internal links or anchors that start with "javascript":

Support for MediaElement

It'd be nice if the plugin handled adding the MediaElement.js Google Analytics plugin integration, if possible. The core repo has a plugin (which might need tweeking) but I don't think this is included in WordPress's version of Media Element.

Shopp eCommerce tracking not working in Google Analytics for Wordpress v 4.3.3

I am having a problem with GA plugin tracking the eCommerce transactions from Shopp. It has worked just fine, but last week I upgraded from Google Analytics for Wordpress 4.2.4 to 4.3.3 and it was still tracking visits, but it stopped tracking eCommerce transactions. Yesterday I decided to downgrade back to 4.2.4 to see if it would start tracking the eCommerce again, but it hasn’t.

I am currently using:
Wordpress 3.5.1
Shopp 1.2.8
Google Analytics for Wordpress 4.2.4 (downgraded back from 4.3.3)

Link to non-existing page in class-admin.php

On line 644 of /wp-content/plugins/google-analytics-for-wordpress/admin/class-admin.php the following url is referenced: <a href="http://yoast.com/wordpress/google-analytics/enable-ecommerce/">.

This page doesn't exist (anymore), so it causes a 404-error.

Little mistake on a translatable string

Hello,

I'm starting to translate in french all missing strings of your extension.

I found a little mistake on http://translate.yoast.com and in .pot file : google-analytics-for-wordpress.pot

The string seems to be not used yet in code.

"This allows you to enable %sCross-Domain Tracking%s for this site.  When "
"endabled <code>_setAllowLinker:</code> will be enabled if it is not already."

endabled must be enabled

Custom Variables -> Authors Not Showing in GA

This is important for anyone monetizing through Adsense so we can see what author/category generates the most revenue.

After the update it seems that the stats went to 0, everything else working just alright.

Hopefully this has a quick fix! Thanks a lot for your time & input!

custom variable author

Google XML Sitemap_Index error: An invalid date was found.

Hi,

I have the latest WordPress (3.9.1) and Yoast (1.5.3.3) plugin installed.

I tried submitting XML sitemap_index generated by Yoast to Google Webmaster Tool and I'm shown the error message below:

Number of children in this Sitemap index 17
Error details: 1 Errors, 0 Warnings.
Error: Invalid Date
An invalid date was found. Please fix the date or formatting before resubmitting.
Issues Count: 1
Line: 49

My sitemap_index below: Number of children in this Sitemap index 17
Sitemap Last Modified
-sitemap.xml 2014-07-10 17:38
-sitemap.xml 2014-07-08 12:02
-sitemap1.xml 2014-07-03 15:07
-sitemap2.xml 2014-07-07 12:14
-sitemap3.xml 2014-07-07 22:37
-sitemap.xml 2014-06-04 15:44
-sitemap.xml 2014-06-04 15:44
-sitemap.xml 2014-06-04 15:44
-sitemap.xml 2014-06-04 15:44
-sitemap1.xml 2014-07-03 14:57
-sitemap2.xml 2014-07-07 12:13
/product_tag-sitemap3.xml
-sitemap4.xml 2014-06-04 15:44
-sitemap.xml 2014-06-04 15:44
-sitemap.xml 2014-06-04 15:44
-sitemap.xml 2014-06-04 15:44
-sitemap.xml 2014-06-04 15:44

"GA is not active" message shown to all users

A minor issue, this warning message is shown to all users:

Google Analytics is not active. You must select which Analytics Profile to track before it can work.

Steps to reproduce:

  1. Install the plugin, but don't add any of the settings.
  2. Log out
  3. Log back in as a subscriber
  4. Visit your admin profile
  5. You will see the warning message
  6. If you click the link, you will get a "You do not have permission to access this page" screen

Expected result:
The user should only be shown the warning message if they have the capabilities to edit the plugin's settings.

customcode needs additional stripslashes?

http://wordpress.org/support/topic/plugin-google-analytics-for-wordpress-custom-code-_setsitespeedsamplerate goes into some length about how saving analytics options twice with the customcode box filled is prone to generating invalid analytics code. Latest version they've tested is 4.3.2. I'm currently on latest stable 4.3.5 and can see the options box is still showing slashes to escape single quotes and saving the options again will double-slash the code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.