CVM / Magento_GoogleTagManager

Google Tag Manager extension for Magento
67 stars 55 forks source link

Dynamic Remarketing Feature Requests #8

Closed juggernaught closed 10 years ago

juggernaught commented 10 years ago

I crucial feature for those who have multi store setup in magento is to have a option to add a prefix and suffix to the prodid. We have multiple store views with the same inventory and google only allows you to have 1 unique prodid. We had to append some characters to the end of each prodid to be unique for each store view. Example 1111-storeview1 and 1111-storeview2 in the case we appended -storeview1 and -storeview2 to the end of the prodid in the data feed.

It woudl also be nice to select which attribute was used for the prodid. Alot of people use produdct id or product sku.

phildpearce commented 10 years ago

There is a work-around for thus using the Qubit dataLayer (you dont need to enable the qubit TMS just the universal dataLayer): https://github.com/QubitProducts/UniversalVariable-Magento-Extension

I have used this technique successfully on another magento website, it is much easier than using URL mapping.

Thanks

Phil.

CVM commented 10 years ago

While I've worked with Google Shopping feeds, I'm not terribly familiar with how they relate to Google Analytics e-commerce transactions - are you saying that the product SKUs in Google Analytics need to match those in the Google Shopping feed?

If this is the case and you want to tweak the values in the dataLayer before firing a transaction, it's a bit messy but you can do this entirely in GTM.

When your transaction rule fires, rather than fire the GA transaction tag immediately, you could instead fire a Custom HTML tag which uses JavaScript to read the contents of the dataLayer, build a new e-commerce transaction data structure (tweaking the sku values along the way), and then trigger a new dataLayer.push() with a different event (e.g. "realTransaction"). This event could then fire the actual GA transaction tag.

All a bit complicated to achieve, really. Essentially adding some logic in the middle to repurpose the data before firing the GA transaction hit.

Hopefully this helps!

phildpearce commented 10 years ago

Hi Chris,

Yes, I am familiar with this method of mapping URL >> ecomm_pagetype

See example; https://www.dropbox.com/s/ka6egrklmy5dsuu/Dev%20-%20Adwords%20Remarketing%20Tag%20with%20custom%20parameters%20via%20GTM%20-%20Andr%C3%A9%20Mafei.pdf

In reality it NOT practical when dealing thousand of URLs! and it creates a maintenance issue on the URL whitelist.

Also for multiple items in the remarket basket, it requires a JS macro for mapping and looping window.universal_variable.product.sku_code >> ecomm_prodid, which again adds to the complexity.

If you make this native, it would greatly simplify the process.

// Adwords Remarketing dataLayer var google_tag_params = { "ecomm_pagetype": "", // home|category|searchresults|product|basket|purchase|other|siteview "ecomm_prodid": "", // e.g. 123 "ecomm_totalvalue": [""], // e.g 100.00 pounds "ecomm_pname": [""], // optional - use arrays for multiple products on same page "ecomm_pcat": [""], // optional - use arrays for multiple products on same page "ecomm_rec_prodid": [""] // related productID e.g. shoe shine };

Please also see the dynamic remarketing example in this containers, it maps the Qubit page category >> ecommpagetype username: coolgtmstuff@gmail.com pw: philsrulesgtm (I did not invest the pw btw) https://www.google.com/tagmanager/web/#management/TagManagement/a28265c485543/%3F.versionId%3D35%26TagManagementPage.mode%3DEDIT_TAG%26TagManagementPage.tagId%3D455/

Screenshot https://www.dropbox.com/sh/py4w7wxt2e10ow0/eMkXrq5tIJ

phildpearce commented 10 years ago

An example of the multiple items in the remarket basket array JS macro is here:

\ only rough code NOT tested **

// js macro to loop through basket.line_items.[n].product.sku_code and return ecomm_prodid: ['sku123', 'sku456'] ///////////////////////// function() { var ecomm_prodid_array = [], currProduct, i, ii; for (i = 0, ii = window.universal_variable.basket.line_items.length; i < ii; i += 1) { currProduct = window.universal_variable.basket.line_items[i]; // ARRAY of window.universal_variable.basket.line_items..product.sku_code e.g. ['sku123', 'sku456'] return ( currProduct.sku ) }