nystudio107 / craft-instantanalytics

DEPRECATED: Instant Analytics brings full Google Analytics support to your Twig templates and automatic Craft Commerce integration with Google Enhanced Ecommerce.
https://nystudio107.com/
Other
20 stars 9 forks source link

Source/Medium for Commerce Conversions are always showing up as the its own domain #43

Closed philipboomy closed 4 years ago

philipboomy commented 4 years ago

Describe the bug

All commerce conversions are attributed to the site itself and not any external sites. This screenshot https://share.getcloudapp.com/yAubog16 shows all revenue to line 1 which is the domain/site itself. When checking normal analytics source/medium is showing other sites.

Google Ads are not tracking conversions which is probably due to the above. If its always the site itself that's registered as the source/medium then Google Ads will not show it as a Google Ad conversion. https://share.getcloudapp.com/Blu5DpmZ

This is the current settings: https://share.getcloudapp.com/jkuZEJpl

Versions

khalwat commented 4 years ago

Perhaps related to: https://github.com/nystudio107/craft-instantanalytics/issues/32

I think it's possible this could be related to an issue fixed in 1.1.18 -- can you try updating to it?

khalwat commented 4 years ago

Addressed in https://github.com/nystudio107/craft-instantanalytics/commit/87bd6a8a077bcc498f4b1959e37621b8c96a4c6e

Can you set your semver to dev-develop and give it a whirl?

khalwat commented 4 years ago

Fix released in 1.1.19 -> https://github.com/nystudio107/craft-instantanalytics/releases/tag/1.1.9

philipboomy commented 4 years ago

I am still not getting correct source/medium. It's all referred to the domain itself which is odd in itself as how do a website refer to itself?

mtwalsh commented 1 year ago

@khalwat Hi, I've been wrestling with this issue for a couple of week now... We're seeing the website's domain e.g. domain.com as the Referrer in Google Analytics for all E-commerce conversions, we're certain this is not correct. If it helps I've pasted the instant-analytics.php config array we're using on the project below. (We're using GTM on the front-end to track page views.)

return [
    /**
     * The default Google Analytics tracking ID
     */
    'googleAnalyticsTracking' => '$GA_TRACKING_ID',

    /**
     * Should the query string be stripped from the page tracking URL?
     */
    'stripQueryString' => false,

    /**
     * Should page views be sent automatically when a page view happens?
     */
    'autoSendPageView' => false,

    /**
     * If you plan to use Instant Analytics in conjunction with frontend JavaScript, this setting should be on, so that Instant Analytics requires a `clientId` from the frontend-set GA cookie before it will send analytics data.
     */
    'requireGaCookieClientId' => true,

    /**
     * Should the GCLID cookie be created if it doesn't exist?
     */
    'createGclidCookie' => true,

    /**
     * The field in a Commerce Product Variant that should be used for the category
     */
    'productCategoryField' => 'productType',

    /**
     * The field in a Commerce Product Variant that should be used for the brand
     */
    'productBrandField' => 'productVariantLabel',

    /**
     * Whether add to cart events should be automatically sent
     */
    'autoSendAddToCart' => true,

    /**
     * Whether remove from cart events should be automatically sent
     *
     * @var bool
     */
    'autoSendRemoveFromCart' => true,

    /**
     * Whether purchase complete events should be automatically sent
     */
    'autoSendPurchaseComplete' => true,

    /**
     * Controls whether Instant Analytics will send analytics data.
     */
    'sendAnalyticsData' => true,

    /**
     * Controls whether Instant Analytics will send analytics data when `devMode` is on.
     */
    'sendAnalyticsInDevMode' => false,

    /**
     * Controls whether we should filter out bot UserGents.
     */
    'filterBotUserAgents' => true,

    /**
     * Controls whether we should exclude users logged into an admin account from Analytics tracking.
     */
    'adminExclude' => true,

    /**
     * Controls whether analytics that blocked from being sent should be logged to
     * storage/logs/web.log
     * These are always logged if `devMode` is on
     */
    'logExcludedAnalytics' => true,

    /**
     * Contains an array of Craft user group handles to exclude from Analytics tracking.  If there's a match
     * for any of them, analytics data is not sent.
     */
    'groupExcludes' => array(
        'somegroup',
    ),

    /**
     * Contains an array of keys that correspond to $_SERVER[] super-global array keys to test against.
     * Each item in the sub-array is tested against the $_SERVER[] super-global key via RegEx; if there's
     * a match for any of them, analytics data is not sent.  This allows you to filter based on whatever
     * information you want.
     * Reference: http://php.net/manual/en/reserved.variables.server.php
     * RegEx tester: http://regexr.com
     */
    'serverExcludes' => array(
        'REMOTE_ADDR' => array(
            '/^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*\:)*?:?0*1$/',
        ),
    ),
];