Amphtml: Problem with _gl tracker

Created on 3 Feb 2021  路  6Comments  路  Source: ampproject/amphtml

HI
I found a problem with using the Html code to call the phone number in AMP page :

<a class="number" href="tel:+111-11111111" target="_blank">賽Call</a>

In the computer (and non amp) it appears correctly
But on the phone, a tracker is added at the end of the number
like that :

+111-11111111?_gl=1*1ym6ytt*_ga*YW1wLTZXM295bXNORVJMdEFEQmQ1SThOM2c.

This causes an error in the phone number, which appears strange when the button is pressed

https://prnt.sc/y2vnw8
https://prnt.sc/y2vpbc

How to fix this problem ?

amp-analytics Bug

All 6 comments

Adding @micajuine-ho, this appears to be related to Linker between domains.

@asfarmed Thank you for your bug report. amp-analytics's Linker forwards the linker param on all outgoing navigation links that fit it's criteria.

Can you please attach the amp-page/reproducible example of this behavior?

@micajuine-ho This problem only occurs when opening the link from the phone device
This is an example https://kushiftasarub.com/amp/

Hi @asfarmed, the problem here is that in one of you amp-analytics elements, in your config you allow list null as your domain:

<amp-analytics type="gtag" data-credentials="include"><script type="application/json">{"optoutElementId":"__gaOptOutExtension","vars":{"gtag_id":"UA-184199625-1","config":{"UA-184199625-1":{"groups":"default","linker":{"domains":[null]}}}}}</script></amp-analytics>

This turns into an empty string in our code, which matches with your href="tel:+966-539134026. To fix this, please allow list a valid domain, instead of null.

@micajuine-ho Do I put the current domain for the site?

You can, that makes the most sense here. See this documentation for more info: https://github.com/ampproject/amphtml/blob/master/extensions/amp-analytics/linker-id-forwarding.md

Was this page helpful?
0 / 5 - 0 ratings