question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

amp-analytics[type=googleanalytics] encoding

See original GitHub issue

To whom it may concern:

I use amp-analytics[type=googleanalytics] to send GA beacon and I have some chinese text content filled in custom dimension.

such as the following sample code:

<amp-analytics type="googleanalytics">
    <script type="application/json">
        "vars": {
            "account": "UA-74300583-2",
            "documentGroup": "itemPage",
            "merchandiseId": "100347591196",
            "level1Id": "1234567890-1",
            "level2Id": "1234567890-2",
            "level3Id": "1234567890-3",
            "level4Id": "1234567890-4",
            "level5Id": "1234567890-5",
            "level6Id": "1234567890-6",
            "level1Name": "中文分類測試-1",
            "level2Name": "中文分類測試-2",
            "level3Name": "中文分類測試-3",
            "level4Name": "中文分類測試-4",
            "level5Name": "中文分類測試-5",
            "level6Name": "中文分類測試-6"
        },
        "extraUrlParams": {
            "cg1": "${documentGroup}",
            "cd1": "${level1Id}",
            "cd2": "${level2Id}",
            "cd3": "${level3Id}",
            "cd4": "${level4Id}",
            "cd5": "${level5Id}",
            "cd6": "${level6Id}",
            "cd7": "${level1Name}",
            "cd8": "${level2Name}",
            "cd9": "${level3Name}",
            "cd10": "${level4Name}",
            "cd11": "${level5Name}",
            "cd12": "${level6Name}",
            "cd13": "${merchandiseId}"
        },
        "triggers": {
            "pageview": {
                "on": "visible",
                "request": "pageview"
            }
        }
    </script>
</amp-analytics>

Notice the level1Name ~ level6Name, these are chinese content. I check the beacon content when page refresh and I found the parameter cd7 ~ cd12 will encode the content. So Google Analytics report will collect the encoded data and hard to recognize.

You can also click the following link to check it. Demo page

Have a nice day.

Paul

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lannkacommented, Dec 8, 2017

This will go to canary release next week, where you can test by opt-in canary. One week after that, it will hit prod.

0reactions
meistudiolicommented, Dec 27, 2017

hi, @lannka:

I chceked my GA report and found this double encoding issue happen again. Looks like code had been rollback.

Could you reopen this issue or should I need to apply a new issue for this ?

Have a nice day.

Paul

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add Analytics to AMP pages - Google Developers
Measure user interaction with AMP pages.
Read more >
Documentation: <amp-analytics> - amp.dev
Usage. The <amp-analytics> component specifies a JSON configuration object that contains the details for what to measure and where to send analytics data....
Read more >
Google AMP - Analytics - Tutorialspoint
Google AMP - Analytics, Amp analytics is an amp component used to track data on a page. All the user interaction on the...
Read more >
Google Analytics for AMP (Accelerated Mobile Pages)
AMP (Accelerated Mobile Pages) means a structure that is coded according to specific guidelines and provides users with a faster browsing ...
Read more >
How to set up Google Analytics - How to AMP - YouTube
In this episode of How to AMP, we go over how to set up Google Analytics for a hiking blog. Analytics help us...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found