Skip to content

Instantly share code, notes, and snippets.

View marcusRB's full-sized avatar
🎯
Focusing

Marco marcusRB

🎯
Focusing
View GitHub Profile
school = 'Massachusetts Institute of Technology'
numVowels = 0
numCons = 0
for char in school:
if char == 'a' or char == 'e' or char == 'i' \
or char == 'o' or char == 'u':
numVowels += 1
elif char == 'o' or char == 'M':
print(char)
@marcusRB
marcusRB / Heat Map Creation Tool - with Devices.js
Created August 10, 2017 17:23 — forked from BrainlabsDigital/Heat Map Creation Tool - with Devices.js
Script to create smoothed heat maps from your AdWords data, optionally segmented by device.
/**
*
* Heat Map Creation Tool - with Devices
*
* This script calculates the smoothed average performance of each hour of each day
* of the week, and outputs this into a heat map and graph in a Google Sheet. This
* can be done for all data and for device data. It also suggests ad schedules and
* device bid adjustments based on conversion rates.
*
* Version: 2.0
@marcusRB
marcusRB / facebook-wca-standard-events.html
Created November 29, 2017 09:28 — forked from danielmcclure/facebook-wca-standard-events.html
Sample Facebook Standard Events for New Facebook WCA (Website Custom Audience) Pixel
<!-- Facebook Custom Audience Pixel Code - Placed on Every Page of Site -->
<script>
!function(f,b,e,v,n,t,s){if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};if(!f._fbq)f._fbq=n;
n.push=n;n.loaded=!0;n.version='2.0';n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];s.parentNode.insertBefore(t,s)}(window,
document,'script','//connect.facebook.net/en_US/fbevents.js');
fbq('init', '{{facebook pixel}}');
fbq('track', 'PageView');
</script>
@marcusRB
marcusRB / ga-classic-ecommerce-datalayer.txt
Created June 30, 2018 09:30
GA Classic Ecommerce for Google Tag Manager dataLayer
<script>
window.dataLayer = window.dataLayer || []
dataLayer.push({
'transactionId': '1234',
'transactionAffiliation': 'Moda Filomena',
'transactionTotal': 38.26,
'transactionTax': 1.29,
'transactionShipping': 5,
'transactionProducts': [{
'sku': 'DD44',
@marcusRB
marcusRB / ga-enhanced-ecommerce-function
Created June 30, 2018 09:37
Variable comercio electrónico mejorado en Google Tag Manager
function() {
var ecommerceData = {
'ecommerce' : {
currencyCode : 'EUR',
// añada parámetros adicionales según sea necesario…
}
};
return ecommerceData;
}
@marcusRB
marcusRB / gtm-datalayer-product-impression
Created June 30, 2018 11:14
Measuring Product Impressions EEC dataLayer
<script>
// Measures product impressions and also tracks a standard
// pageview for the tag configuration.
// Product impressions are sent by pushing an impressions object
// containing one or more impressionFieldObjects.
dataLayer.push({
'ecommerce': {
'currencyCode': 'EUR', // Local currency is optional.
'impressions': [
{
@marcusRB
marcusRB / gtm-datalayer-product-click
Created June 30, 2018 14:31
Measuring Product Clicks EEC dataLayer
<script>
/**
* Call this function when a user clicks on a product link. This function uses the event
* callback datalayer variable to handle navigation after the ecommerce data has been sent
* to Google Analytics.
* @param {Object} productObj An object representing a product.
*/
function(productObj) {
dataLayer.push({
'event': 'productClick',
@marcusRB
marcusRB / gtm-datalayer-product-details
Created June 30, 2018 14:38
Measuring Views of Product Details EEC dataLayer
<script>
// Measure a view of product details. This example assumes the detail view occurs on pageload,
// and also tracks a standard pageview of the details page.
dataLayer.push({
'ecommerce': {
'detail': {
'actionField': {'list': 'Apparel Gallery'}, // 'detail' actions have an optional list property.
'products': [{
'name': 'Triblend Android T-Shirt', // Name or ID is required.
'id': '12345',
@marcusRB
marcusRB / gtm-datalayer-add-to-cart
Created June 30, 2018 14:42
Adding a Product to a Shopping Cart EEC dataLayer
// Measure adding a product to a shopping cart by using an 'add' actionFieldObject
// and a list of productFieldObjects.
dataLayer.push({
'event': 'addToCart',
'ecommerce': {
'currencyCode': 'EUR',
'add': { // 'add' actionFieldObject measures.
'products': [{ // adding a product to a shopping cart.
'name': 'Triblend Android T-Shirt',
'id': '12345',
@marcusRB
marcusRB / gtm-datalayer-remove-from-to-cart
Created June 30, 2018 14:44
Remove a Product from to Shopping Cart EEC dataLayer
// Measure the removal of a product from a shopping cart.
dataLayer.push({
'event': 'removeFromCart',
'ecommerce': {
'remove': { // 'remove' actionFieldObject measures.
'products': [{ // removing a product to a shopping cart.
'name': 'Triblend Android T-Shirt',
'id': '12345',
'price': '15.25',
'brand': 'Google',