Google Analytics is not tracking every page - php

Google analytics is installed on my website. My website is built using Wordpress and using the plugin "Insert Headers and Footers" I pasted the code from Google Analytics. I can confirm that it works on some pages, but not all.
The website is an e-commerce store so not having the tracking on every page is making it hard to establish funnels.
I realized my e-commerce data was not being tracked so I researched the issue and learned about Google Tag Assistant. I installed this add-on and sure enough, no tags are reporting back for some of my store pages.
The below screenshot is from the Google Analytics report from the Tag Assistant. It shows that no tags are set on my page https://www.californiabeardco.com/store/ or https://www.californiabeardco.com/product/beard-oil/
The main site is https://www.californiabeardco.com
Interestingly, the analytics seem to work on the homepage and the cart/checkout pages, but not the store/product pages.
I'm really not sure what to do, I thought that the insert headers and footers plugin would insert the analytics code onto every page on my site.
I appreciate any insight you may have to offer, thanks!

Is there a particular event that isn't reporting that you are expecting to see?
Using the 'Google Analytics Debugger' Chrome extension, I can see that Google Analytics is initialized on each page and is reporting page views.

I think you recently added Google Analytical Code.Give it some time and Google will fix this. I added it in one of my site and my problem was same as you. I waited for 1-2 weeks until it resolved automatically.

Why can You just paste Google code to footer.php ? Other problem can be ajax pagination but this also can be fixed by refresh code after every ajax request.
Ps. And yes, sometimes You just must wait and Google will start working. You can check page source - if there is google code then it will start working, if not - You make something wrong.

Related

Prevent PHP file being included if website is listed in Google search results

working with a custom built click tracking solution within Laravel.
I have a PHP file that is included on each page that sends off an API call to another site that tracks each visit.
I've done plenty of work to make sure it ignores scrapers and crawlers etc but it's still firing everytime the website is shown within Google search results.
Is there something I can do that will be prevent this file being included unless its an actual visit?
Currently getting a lot of 'organic' visits tracking when its not a visit but instead just someone seeing the website listed on Google.
Thanks.

Google Analytics PHP API : get reporting

I have a professional website using Google Analytics for metrics and I try to automatize one task I used to do manually but.. not able to understand if it's possible ?!
I just began to using the Google PHP client library to access the Google Analytics API on my website Test with the HelloAnalytics.php file is OK, I manage to connect and retrieve my data.
What i'm trying to do is :
Get all URLs viewed in the past 24H (what you can see when you navigate in the GA dashboard -> Behavior -> Site content -> All pages)
Combine those datas with my custom Definition which is in fact a special token i generate for every users on my website via PHP, then send it thought with Javascript and ga('set', 'mycustomdefinition', 'my token');
Is it possible ?
Many thanks in advance for your support !
Data under 24-48 hours old has probably not completed processing so I recommend not looking at data viewed in the last 24 hours it wont be correct. Other wise yes you can see this.
Assuming you mean custom Dimension yes you can extract custom dimensions and the page path in the same request.
You might want to have a look at the Dimensions & metrics explorer as well as the google analytics query explorer both will help you understand what data can be extracted from the API.

My site displayed deceptive site ahead message

I am a beginner in web development. I am developing a website. From few days my site is not gonna run in good way. When i write down the URL of site and hit enter key. Than a window is displayed.
I searched it on google. But i'm failed to sort out this.
I don't understand how to remove it. Please any one can help me how i can sort out this.
Thanks
Add your site to google webmasters and check which urls / pages are creating errors under security issues. Simply delete / fix that files and submit review request to google.
More info, http://www.wpbeginner.com/wp-tutorials/how-to-fix-this-site-ahead-contains-harmful-programs-error-in-wordpress/

google analytics api in php website

I am creating a custom reporting website, where I want to show live data from google analytics and accordingly the data in my website will change. I want it to be automated and dynamic, like whenever the data changes in GA, i want it to be automatically changed in our website, which will be shown to our clients to show the performance of our websites.
I am guessing this can be achieved by some api calling from php, xml returned values and showing those data on our website along with images.
i would appreciate if anyone could give me more info on how to start working on this.
Google Analytics has an official API. They don't seem to have ready-made PHP examples, but the XML sources should be easy to query. Not sure how "live" GA's data is, though - it could be that it is not possible to do stuff live tracking of visitors.

How do I block Google adsense linking to files on my server?

Today I noticed that a few Google advertisements in an adsence block on one of my pages were trying to display a file called "/pagead/badge/checkout_999999.gif" from my server. I did a bit of investigating and found out that the companies behind these adverts use Google Checkout and "checkout_999999.gif" is supposed to be a tiny shopping kart icon with a tooltip which reads "This site accepts Google Checkout".
My problem is that "/pagead/badge/checkout_999999.gif" doesn't exist on my server. What do you do to handle this on your website? e.g:
Save the logo () on your server in the place it is expected by Google?
Use a mod_rewrite rule to redirect the request? To where though?
Find a adsense option to turn off Google checkout enabled adverts? (I looked but couldn't see one?)
Ignore the issue and get on with something important
Back-story - please ignore unless very bored: Page 2 of the search page on our site suddenly stopped working and I didn't know why. It turned out to be related to Google adsense. We use PHP session variables to save search criteria over different pages which worked fine for a while but then randomly stopped working. Random bugs are the worst! I was trying to work out what else is random on the page and decided that the Google ads were the only other random thing. Sure enough, sometimes a particular advert seemed to clear the session variables and break the search. What was actually happening was that the advert was requesting a image from our server ("checkout_999999.gif") which didn't exist and Apache was behind-the-scenes redirecting to the site homepage which unfortunately clears the session variables needed for the search - hence the non-obvious breakage. I'm a bit worried that Google ads can request random files from my sever? I'd prefer if they could only use absolute URL's if they want to include logo's or other media.
Sounds like a bug with google adsense delivery. File a bug with them is your best bet for a long-term fix.
After playing around with Apache mod_rewrite for a while I have found a rule that seems to fix my Google Adsense issue:
RewriteRule ^\/pagead\/badge\/checkout\_999999\.gif$ http://pagead2.googlesyndication.com/pagead/badge/checkout_999999.gif [R=301,L]
The problem is I'm not sure how to stop a similar thing happening in the future if Google decides to hotlink to a different file?
As Google doesn't care about the problem (previous posts were sent in June and we are now in October... and the bug was reported directely to Google), I decided to put an image on my server that would suggest the user to click on the ad!
Clicks then increased!!
As this is my server, I can do what I want and that's not my problem if Google asks for files on my server. They cost me money by using my bandwidth and connecting to my server, I am now paid for that!!
You should do the same...

Categories