Two analytic (Google and local) with mobile-theme & AMP

Posted in: Newspaper
Post count: 11

Hi,

is it OK if I use codes for Google Analytics and Yandex.Metrika local analytics not with Newspaper mobile theme AMP Analytics section,
but with original WordPress AMP Plugin Analytics?
As I could see there is only one place for GA but not for another analytics in mobile theme AMP analytics section.
Or is there any posibility to paste other code simultaniously with GA within Newspaper mobile AMP analytics?

Many thanks,
Denis

Post count: 20688

Hi,

So you using just the AMP plugin and not the mobile theme plugin. You want to add a Yandex.Metrika analytics code in AMP. I found a guide in the matter
https://yandex.com/support/metrica/code/install-counter-amp.html
Seems it requires that a script be added in the head section of the plugin, and then the actual code after the body tag. Maybe follow these instructions as mentioned, should work as they say.

Thanks

Post count: 11

Hi,
no, I use both – WP AMP plugin + Mobile theme.
According to TagDiv instructions I add Google code at AMP section of Newspaper theme. But there is no place for any other analytics.
Is it OK if I add Metrika at WP AMP Plugin?
Also is it OK iff all analytics will live at WP AMP Plugin but not Mobile theme AMP Section?
That was the question.
Sorry for my english,
thanks

Post count: 20688

You could try and enter it in the mobile theme analytics, of this form
http://prntscr.com/mx9twh
Seems to be similar to a analytics code, it may work this way. Enter it and keep check to see if it works, maybe wait for a while before checking.

Post count: 11

Thank you
But how to separate two codes and use it simultaneously in one field?

Post count: 20688

You can enter analytics code in the AMP plugin section and in the mobile theme section. Both sections will load the code properly. Or enter them all in the AMP plugin analytics section.

For example enter the Google analytics code in the theme panel section, and the other ones in the AMP plugin section, there you can enter multiple codes from the vendors you are using
https://www.ampproject.org/docs/analytics/analytics-vendors

Post count: 11

Hi,
as I understood there could be 3 kinds of pages:
1) for desktops (Yandex Metrika code do exist);
2) AMP pages (Yandex Metrika code do exist);
3) mobile theme responcive pages for mobile devices (no Yandex Metrika code exist).

Where should I place Yandex Metrika code for Responcive pages (not AMP pages)?

  • This reply was modified 7 years by Denis Ugryumov. Reason: try to make the problem description clearer
Post count: 20688

Hi,

The mobile theme will load the general theme panel analytics as well, so any code or script entered here – http://prntscr.com/nypsqz will be loaded in desktop and also in the mobile version as well – http://prntscr.com/nypu2g

If I misunderstand let me know.
Thanks

Post count: 11

Hi,
thank you! Yes, the question was about this.

But if I need to place analytics script code inside footer?

It do works fine in desktop theme if analytics code was placed in footer.
And I could see test code if it was placed in header.
But no test code in mobile theme at all if it was placed in footer.

Put the code at header and will check how it works there.
But the question still exist why it doesn’t appear if placed in footer…

Post count: 20688

Hi,

Seems that the footer script code will load only in desktop, and not in mobile. The header script code will load on both. I will add this on the list and maybe it will be modified to load on mobile as well.
You could enter the code manually in the mobile footer file – http://prntscr.com/nzs831 this would work. Sorry for the inconvenience.

Viewing 10 posts - 1 through 10 (of 10 total)
The forum ‘Newspaper’ is closed to new topics and replies.