Google analytics (via tag manager) loses track of adwords visitors after first pageload

前端 未结 2 1576
深忆病人
深忆病人 2021-02-09 07:55

I am experiencing a very strange problem with Google tag manager (GTM), Google analytics (GA) and Google adwords. So far I am getting nowhere with solving it.

Th

相关标签:
2条回答
  • 2021-02-09 08:06

    We at betabrand.com are having very similar troubles.

    Last month we switched from a multipage to a single page app using angularJs and immediately starting getting bad advertising revenue tracking both Universal Analytics and Google Analytics.

    We are also using Google Tag Manager to fire off our events.

    Our current lead is a tidbit from https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications

    Which states:

    Do not update the document location

    In the same way that the tracker uses document.referrer for the referrer field, it uses document.location for the location field, which will often contain campaign data or other meta data in the form of query parameters appended to the end of the URL.

    Updating any of the campaign fields or other meta data that Google Analytics is checking for may cause the current session to end and a new session to begin. To avoid this problem, do not update the location field when tracking virtual pageviews in a single page application. Use the page field instead.

    It also includes this note

    Note: if you send a hit that includes both the location and page fields and the path values are different, Google Analytics will use the value specified for the page field.

    To us, this says that if you include the 'page' field it will trump a 'location' field value and that if you include a 'location' field without a 'page' field after the initial page load you run the risk of starting a new session possibly with the campaign tracking stripped.

    Using the google analytics debugger chrome extension we were able to identify events that were indeed firing a location parameter and without a page parameter.

    A user hits our page, GTM fires a page view with the 'location' parameter. Subsequent virtual page views were including both 'location' and 'page' parameters. However we were also firing an event when a user opens their shopping cart that and that includes a 'location' parameter and not a 'page' parameter.

    We just updated our GTM configuration to try to remedy this and have our fingers crossed that it will work. I'll update my post if we find a solution.

    We've been wrestling with this for WAY too long now.

    0 讨论(0)
  • 2021-02-09 08:21

    I'm facing the same problem (currently implementing the solution.. only did some research) and it might have something to do what Google only is mentioning in their docs briefly, namely: Do not create new trackers. GTM does create a new tracker each time..

    Possible solution

    Do not let GTM initiate a new tracker each time but set trackerName in GTM like 'spaTracker' for your Single Page App.

    All credits go to Thyngster.

    0 讨论(0)
提交回复
热议问题