GithubHelp home page GithubHelp logo

magepal / magento1-google-tag-manager Goto Github PK

View Code? Open in Web Editor NEW
42.0 9.0 16.0 50 KB

Google Tag Manager (GTM) with Data Layer for Magento 1 / OpenMage LTS

Home Page: http://www.magepal.com

PHP 87.32% HTML 12.68%
magento1-module gtm magento magento-extension google-tag-manager cart openmage openmage-module

magento1-google-tag-manager's Introduction

magepal

MagePal Extensions - Install our extensions with confidence knowing that they will just work! But if you run into an issue... no problem, we normally solved all issues in 15 minutes or less.

magento1-google-tag-manager's People

Contributors

alex-koepke avatar alexkoepke avatar borhi avatar hans2103 avatar niccifor avatar seansan avatar srenon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

magento1-google-tag-manager's Issues

DataLayer empty on checkout success

I've noticed that on a success page the datalayer stays empty. This results in no Conversions data in Google Analytics.

https://github.com/magepal/magento1-googletagmanager/blob/ea400d7945d44443aa32f45dea28abcf08e440c2/app/code/local/MagePal/GoogleTagManager/Block/Tm.php#L155

when I do a var_dump(!$this->_orderCollection) I get an order id.
I was expecting to get order information

Therefor I've removed the if-statement around this block and now it works.

Can you reproduce this issue?

DataLayer - PageType

Great module guys - currently the pageType comes through the datalayer using Magento page types, e.g. catalog_category_index for category. However Google needs it to follow their naming;

This is from Google;
ecomm_pagetype | Indicates the type of page that the tag is on. Valid values:

  • home Used on the home page or landing page of your site.
  • searchresults Used on pages where the results of a user's search are displayed.
  • category Used on pages that list multiple items within a category, for example a page showing all shoes in a given style.
  • product Used on individual product pages.cart Used on the cart/basket/checkout page.
  • purchase Used on the page shown once a user has purchased (and so converted), for example a "Thank You" or confirmation page.
  • other Used where the page does not fit into the other types of page, for example a "Contact Us" or "About Us" page.

Example usage:

var google_tag_params = {   ecomm_pagetype: 'searchresults'};

Script Rendering Incorrectly?

In Magento CE 1.9.3.2, I'm seeing the Script generated by this plugin render incorrectly, essentially not sending the correct URL back to the container:

`

--
  | <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
  | new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
  | j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
  | '//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
  | })(window,document,'script','dataLayer','GTM-XXXXXXXXXX');</script>
  |

`
Essentially it's dropping the https: in Line 4. Is this a bug that anyone is aware of, or perhaps a plugin conflict? (GTM code hidden on purpose, of course)

How are we handling GDPR here?

How are we handling GDPR here?

This data is no longer allowed to be sent and shared (without prior optin consent)

customer.isLoggedIn
customer.id
customer.groupId

does not auto append to .gitignore

I have tried adding the following to the composer.json in my own forked repo but can't seem to get it to auto-append to the .gitignore any help would be much appreciated.

"extra": { "map": [ ["app/code/local/MagePal/GoogleTagManager","app/code/local/MagePal/GoogleTagManager"], ["app/design/frontend/base/default/layout/magepal_googletagmanager.xml","app/design/frontend/base/default/layout/magepal_googletagmanager.xml"], ["app/design/frontend/base/default/template/magepal/googletagmanager","app/design/frontend/base/default/template/magepal/googletagmanager"], ["app/etc/modules/MagePal_GoogleTagManager.xml","app/etc/modules/MagePal_GoogleTagManager.xml"] ], "auto-append-gitignore": true }

@hans2103 only tagging you because you were so kind to get this ball rolling :)

Feature Request: Support the enhanced ecommerce Data Layer format

This module is excellent - and to make it even better - why don't you change the sample DataLayer format to support the Google recommended , enhanced ecommerce data layer format so users can take advantage of awesome reports such as:

  • The Shopping report
    image

  • The checkout report
    image

  • The Product Listing report
    image

All that needs to be added:
( I can add the exactly JS for magento if needed)

The starting ones that I would use are: ( hyperlinked to sample calls)

Feature request: catalog send products list

On catalog view we are not sending an array list of products

I have seen other extensions sending the first 6, 12 or 24 to "at least" have some

Can we

  • add a field to enable "sendCatalogProductsqty", defaults to 0 = off
  • any other number sends the first X products as an array (SKU and/or ID only)

How to implement the Google Tag Manager container code has changed.

The recommendations for how to implement the Google Tag Manager container code have changed.

To implement Google Tag Manager on your website:

  1. Copy the following JavaScript and paste it as close to the opening tag as possible on every page of your website, replacing GTM-XXXX with your container ID:
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXX');</script>
<!-- End Google Tag Manager -->
  1. Copy the following snippet and paste it immediately after the opening tag on every page of your website, replacing GTM-XXXX with your container ID:
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

How to implement the Google Tag Manager container code has changed.

The recommendations for how to implement the Google Tag Manager container code have changed.

To implement Google Tag Manager on your website:

  1. Copy the following JavaScript and paste it as close to the opening tag as possible on every page of your website, replacing GTM-XXXX with your container ID:
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXX');</script>
<!-- End Google Tag Manager -->
  1. Copy the following snippet and paste it immediately after the opening tag on every page of your website, replacing GTM-XXXX with your container ID:
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

Undefined variable: items

While looking into the logging I notice the following error to pass by once in a while.

2017-01-09T22:15:58+00:00 ERR (3): Notice: Undefined variable: items  in /data/ssd/vhosts/example.com/httpdocs/.modman/magento1-googletagmanager/app/code/local/MagePal/GoogleTagManager/Model/DataLayer.php on line 164
2017-01-09T22:16:11+00:00 ERR (3): Notice: Undefined variable: items  in /data/ssd/vhosts/example.com/httpdocs/.modman/magento1-googletagmanager/app/code/local/MagePal/GoogleTagManager/Model/DataLayer.php on line 164

(changed our domain to example.com)

How can this notice appear? And how can it be solved?

Pushing and matching configurable transaction data

How can we add configurable / parent products here too?

On page view we are sending parent sku

Here on order success I fear we are sending child data

(so there is not match)

   protected function getOrdersTrackingCode()
    {
        $collection = $this->getOrderCollection();

        if(!$collection){
            return;
        }

        $result = array();

        foreach ($collection as $order) {

            foreach ($order->getAllVisibleItems() as $item) {
                $product[] = array(
                    'sku' => $item->getSku(),
                    'name' => $item->getName(),
                    'price' => $item->getBasePrice(),
                    'quantity' => $item->getQtyOrdered()
                );
            }

How to install the plugin?

Hello,
the SEO agency for our client want me to install this plugin.
Unfortunatelly there is no install guide in your readme. Can you provide some details on this topic, please?
Thanks in advance.

feature request: how do we handle a sale?

  1. How are we handling sales when users reach success.phtml?
    I am not seeing the recording of a sale

  2. about 30% never reaches success.phtml so a sale is not recorded
    Can we add a simple cron job that triggers on Invoice or pay event? + pushes a variable of the order id to success.phtml and this way triggers the firing of all GTM code and scripts

Documentation for installation?

This is an excellent module however its not clear for developers what needs to happen to completd the installation after the module has been imported. The details about the XML is really key to it working. Ideall we should have a screen of what it looks like if its correctly installed.

If someone can add install instructions to the read me it would be great. I don't mind adding a bit on how to test the dataLayer objects from GTM perspective.

Great job on this module!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.