MP Analytics- data not flowing

Hi I've been trying to get analytics to track my eCommerce conversions for over a year.

It used to work flawlessly but for some reason last year it stopped working. I've spent quite a lot of time trying to work out how to fix it using Chrome extensions but a solution is beyond me.

It is only the MP pages that are affected.

Support access is enabled. Any assistance gratefully accepted.

Thanks
Paul

  • Paul

    Hi Dimitris

    Thanks for your reply.

    I'm not absolutely sure as it was my brother who set up Analytics for me.

    I have a feeling it was all working until I changed my theme from Zenon to Twenty Thirteen.

    Yes, that's right- all pages are working but data is not flowing for the eCommerce section- so I can't see how products are performing but I can see which pages people visit, including the store, checkout and cart

    I hope that helps. Thanks,

    Paul

  • Adam Czajczyk

    Hello Paul!

    I checked your site and I can see that on "Store Settings -> General" page in "Google Analytics Ecommerce Tracking" section there's "New" option selected.

    Currently Google Analytics is using so called "Universal" tracking code, while back in the past there were two other versions available. For some time they worked "alongside" but since some time Google is switching all the sites to Universal code.

    That said, could you try please switching it to "Universal" then giving it a while so Google Analytics could record some traffic and then see if that helped?

    Let me know about result please.

    Kind regards,
    Adam

  • Dimitris

    Hey there Paul,

    hope you're doing good today! :slight_smile:

    Could you please grant us with support access to your website to have a better look inside?
    You can do so via WPMUDEV Dashboard plugin, no need to share credentials, as described here:
    https://premium.wpmudev.org/docs/getting-started/getting-support/#chapter-4

    Also, could you please advise us how you insert the Google Analytics tracking code?
    It seems that something is broken considering that... :thinking:

    Please advise!

    Warm regards,
    Dimitris

  • Predrag Dubajic

    Hi Paul,

    I had a look at your site and as Dimitris mentioned above there's a semicolon on your site that's added from somewhere and you can see it in your site header.

    I had a look at your theme files and in your header.php file there's this line of code:
    <script src="//code.tidio.co/oxbofmhxqufpgv7vupigniejy2eqwpdt.js"></script>;

    There's a semicolon at the end of it and that's most like what's showing on your front end and that should be removed.

    I'm also not familiar with that script there so I'm not sure what it does and if it can interfere with Analytics script.
    I would suggest creating a backup of that file, remove above mentioned line completely and check the results from analytics after that.

    Let us know how it goes.

    Best regards,
    Predrag

  • Paul

    Hi Predrag
    Analytics and webmaster tools are a bit mysterious to me so I apologise for this.

    The script above is new and runs a chat popup. I have this running because I've had lots of issues with checkout and I want to catch people before they bounce. I have edited to remove the semicolon and chat is still working so we'll see if this brings the non-MP pages back now.

    Looking at my analytics account I think one issue is that my ownership failed last year: this coincides with my loss of data so I think this may be what's happened.

    I'm a a bit confused though- isn't google analytics plugin taking care of writing the ownership confirmation script into the pages of my site for me? Given that I had data flowing from everywhere but ecommerce conversions (product performance etc.). So it would seem the tags have been working everywhere except at the final checkout even though google tells me I haven't confirmed ownership.

    I'm find this confusing.

    Edit: yes, data was flowing from most of the site- just conversions were not- until march 13th then nothing.

    Many thanks
    Paul

  • Dimitris

    Hello Paul,

    I trust you're doing good today! :slight_smile:

    The script above is new and runs a chat popup. I have this running because I've had lots of issues with checkout and I want to catch people before they bounce. I have edited to remove the semicolon and chat is still working so we'll see if this brings the non-MP pages back now.

    Appreciate the feedback here. You should be able to track "live traffic" in Google Analytics dashboard, so leaving a tab open in your browser and inspecting this live traffic should do the trick for you (you may have to open your website in a incognito window).
    Reference: https://support.google.com/analytics/answer/1638635?hl=en

    Looking at my analytics account I think one issue is that my ownership failed last year: this coincides with my loss of data so I think this may be what's happened.

    As for the site verification process of Google, you can find all appropriate information and resolution instructions here: https://support.google.com/a/answer/1071480?hl=en

    As for the error in console we mentioned before, this seems to still be in place due to the CORS policy: "No 'Access-Control-Allow-Origin' header is present on the requested resource."
    More info on this can be found here
    http://stackoverflow.com/questions/20035101/no-access-control-allow-origin-header-is-present-on-the-requested-resource

    What I want you to do, is to go to Google Analytics plugin settings here
    https://thedruidsbrew.co.uk/wp-admin/admin.php?page=googleanalytics%2Fsettings
    and either "authenticate with Google" and select the appropriate account or "manually enter tracking ID" as it seems that right now there's no tracking code coming from your website.
    After doing so, and as long as you're a verified owner by Google, you should be able to get data in your Google Analytics account (you can use the "live traffic" workaround I mentioned before to double check this).

    Hope that was some help, let us know about your results on this!
    Warm regards,
    Dimitris

  • Paul

    Hi Dimitris

    I've done my best to follow the directions and added a G suite account and copied the meta tag into the header. Google analytics is telling me I have a pending verification.

    I've also re-authenticated the site using the analytics plugin.

    As a precaution I have deleted the javascript for the chat widget for the moment.

    I can see live traffic on the site on analytics at the moment so we'll have to see if this translates into records.

    I'll get back to you once verification is complete.

    Thanks for your help.

    Regards
    Paul

  • Paul

    I'm afraid the above steps have not worked.

    At least I can see data from the site except for conversions again.

    I'm not sure how to follow up on this issue:
    "As for the error in console we mentioned before, this seems to still be in place due to the CORS policy: "No 'Access-Control-Allow-Origin' header is present on the requested resource." "

    I am really desperate to get this sorted out.

    Many thanks
    Paul

  • Adam Czajczyk

    Hello Paul!

    The CORS issue seems to be caused by the JS code that's in the footer of your site that specifically tried to post to this URL:

    https://thedruidsbrew.co.uk?ga_action=googleanalytics_get_script

    I'm not sure where this code comes from because nor MarketPress neither our Google Analytics plugin should be using such code. Note please however that there's a hard-coded "https" prefix while the site is running over "http" connection.

    However, when you access the site over https (which is not default) the issue goes away as both the site and that post that's called out by aforementioned JS script are handled of SSL secured connection.

    Can you tell me please over which protocol your site is usually visited - is it http:// or https://? When you're testing GA issue - are you loading the site over http or https?

    I'd also like to take a closer look at your setup again but it seems that support access has expired. Would you mind granting it again so I could check the site?

    Best regards,
    Adam

  • Adam Czajczyk

    Hello Paul!

    Thank you for your replay and for granting access.

    If the site is used over the HTTPS the CORS issue wouldn't be a case as it doesn't occur. I have checked your site again and I found out that the code that I mentioned in my previous post (that's causing CORS for non-https connections) comes from your Google Analytics plugin.

    I suppose however that this might be the issue here too because the way the plugin calls Google Analytics scripts may not support e-commerce tracking. I check plugin's support page and it does support goal tracking but the goal tracking is entirely configurable on GA dashboard side.

    The E-Commerce tracking requires a code to be injected to the site and that code also requires GA code to be present on the site. However, the plugin that you are using doesn't add/inject the GA code to the site but instead it "calls it out" by posting some data to it via ajax. What I mean by that is that it's possible that it simply doesn't pass all the necessary data and those are not picked by GA code from the site because... GA code is not really there.

    I know it sounds a bit "twisted" by I'd like to ask you to switch that plugin off and instead give a go to our own Google Analytics+ plugin. Authorization/setup is nearly the same as for the one that you are using. Our plugin however doesn't call GA scripts by AJAX but injects them into pages. Could you give it a try, just for testing for now?

    You'll find the plugin here:
    https://premium.wpmudev.org/project/google-analytics-for-wordpress-mu-sitewide-and-single-blog-solution/

    I have also given it a try but so far I have no data as - except the "live" section - everything shows up with a few hours delay in my Google Analytics dashboard so I'm not sure yet if that worked for me or not :slight_smile:

    If you could give it a try it would give us some reference point and either would solve the issue or I'd get a picture of the case broad enough to speak to our developers.

    Best regards,
    Adam

  • Adam Czajczyk

    Hello Paul!

    I checked the site and it seems to be setup fine. I see that GA code is "injected" into the site's source code, the settings ("use Universal Analytics") is consistent in both GA plugin and MarketPress configuration.

    I don't have any access to your Google Analytics account though to make more tests and see if that's all setup fine there so perhaps you could make some test purchase on your site to see if that data comes through? It would be best to do this while you're not logged in as administrator to the site but if that works as expected even a single purchase should be registered. If it doesn't work still we'll investigate it further. Just let me know and I"ll ask you for some more access data (providing you with a way to send them securely) and I'll ask our 2nd-line support for some assistance.

    Best regards,
    Adam

  • Paul

    Hi Adam

    Thank you. Yes, I ran a test purchase yesterday and there was some natural activity on the site too. No record of this in any of the Conversions categories. Data seems to be there for the rest of the website except for the period March 13 to March 24.

    I can see I am not getting any warnings in the analytics console- this was typically saying no data was flowing so something seems to have improved.

    Many thanks
    Paul

  • Adam Czajczyk

    Hello Paul!

    Thank you for your replay.

    I can see I am not getting any warnings in the analytics console- this was typically saying no data was flowing so something seems to have improved.

    I think tracking codes should be working fine then. I did however conduct some more tests on my end and I must say I wasn't able (taking the delay that occurs for me in data presentation in GA dashboard) that I too wasn't able to make it work as expected.

    That being said, I have just asked our developers for suggestions and I'm awaiting their replay. I'll update this thread for you as soon as I get a response so please keep an eye on it.

    Best regards,
    Adam

  • Dimitris

    Hey there Paul,

    hope you're doing good today! :slight_smile:

    Changing the active theme shouldn't resolve either the MarketPress issue or any protocol related issues. As for the later, please create a separate thread if not already, and a representative from our support team will be in touch with you as soon as possible.
    https://premium.wpmudev.org/forums/#question

    As for the tracking issue, I can see that there is some development which is under testing, so me or another colleague of mine will keep you posted here as soon as we've got any hotfix to provide to you! :slight_smile:

    Have a good one,
    Dimitris

  • Paul

    Hi Panos
    I have followed the process above and extracted the files you sent me. I have also checked the store is still functioning from incognito and it seems to be, thanks.

    I have noticed that my google settings were defaulting to http not https so I have changed this in google.

    On doing so, I got the warning that data isn't flowing again but this was before I uploaded the files. I have hit "Re-check" and will wait 24hrs before reporting back.

    Thanks a lot
    Paul

  • Panos

    Hey Paul ,

    This is strange...It seems to be working for me, just tested it:

    I also checked your files and see you have already replaced them so you should be seeing what I am seeing in my google analytics (ga) dashboard.

    In order to enable the e-commerce on ga, click on the "Admin" button at the bottom of your left side menu and you should see a screen similar to this:

    where you need to click on the e-commerce link to activate:

    If you are still not seeing it make sure the date range is correct.

    I would try to avoid sending in google account credentials cause it has access to the entire account including drive and gmail. However if we have no other way you can send in google account credentials using our contact form :
    https://premium.wpmudev.org/contact/#i-have-a-different-question
    and for subject use "Attn: Panos Lyrakis" so it gets assigned to me.

    Before sending this info in, please change your password :slight_smile:

    Thanks!