Skip to content

Instantly share code, notes, and snippets.

View alewolf's full-sized avatar

Aleksandar alewolf

View GitHub Profile
@alewolf
alewolf / gist:daae9228b396e3fd6216b5d72af17da7
Last active November 17, 2017 20:52
AdWords Script: Triple Match
// Title: Triple Match
// Descritpion: Adds the missing match types of each keyword in every ad group
// Author: Wolf+Bär Agency, Aleksandar Vucenovic
// License: GNU GPLv3
// Version: 0.1
// URL: https://gist.github.com/alewolf/daae9228b396e3fd6216b5d72af17da7
// URL:
// START Settings
@alewolf
alewolf / gist:2d8e85a9a753fa5ee4039fb1f779f878
Last active November 17, 2017 21:09
Automatic AdWords Website Phone Conversion Script
<script type="text/javascript">
// In contrary to the original AdWords Phone Conversion Tracking Script this version doesn't require changes on the website. It even can implemented using Google Tag Manager.
// The original AdWords script requires an additional <span> element with an id that encloses the phone number.
// This new script doens't require that span element anymore. It autoaticall searches through the entire document and changes all phone numbers that match. Also it searches through all href sources and changes the phone number there too (for clickable phone numbers).
// In this version of the script there is one requirement though. The phone number on the website has to bee written in the exact same format, with spaces, etc. Only then the script will find and exchange the numbers.
// AdWords phone conversion ID. Since this is a number no quotation marks are necessary.
var gak = CONVERSION_ID; // eg. 12345678912
// AdWords conversion label
@alewolf
alewolf / gist:91bc532014453ec2eac801bf342ee1f9
Last active November 28, 2017 11:00
AdWords MCC Script: Switch all broad match keywords to modified broad match
/*
* Title: Modified Broad Match MCC
* Descritpion: Switch all broad match keywords to modified broad match
* Author: Wolf+Bär Agency, Aleksandar Vucenovic
* License: GNU GPLv3
* Version: 0.4
* URL: https://gist.github.com/alewolf/91bc532014453ec2eac801bf342ee1f9
* URL:
*/
@alewolf
alewolf / gist:ae90ea9c658df09b08d129f58575213c
Last active March 19, 2018 16:30
AdWords MCC Script: Triple Match
/**
* Title: Triple Match MCC
* Descritpion: Adds the missing match types of each keyword in every ad group
* Author: Wolf+Bär Agency, Aleksandar Vucenovic
* Website: https://wolfundbaer.ch
* License: GNU GPLv3
* Version: 0.4
* URL: https://gist.github.com/alewolf/ae90ea9c658df09b08d129f58575213c
* URL:
*/
<?php
// replace reply-to email address for WooCommerce customer emails
add_filter( 'woocommerce_email_headers', 'new_customer_order_reply_to_email_address', 20, 3 );
function new_customer_order_reply_to_email_address( $header, $email_id ) {
$customer_email_ids = array(
'customer_on_hold_order',
'customer_processing_order',
@alewolf
alewolf / .htaccess
Last active October 30, 2019 09:43
# BEGIN WPML Redirect
RewriteEngine on
RewriteCond %{QUERY_STRING} lang=(..) [NC]
RewriteCond %{REQUEST_URI} !^/wp-admin [NC]
RewriteRule ^(.*\/)|^$ /%1/$1? [L,R=301]
# END WPML Redirect
@alewolf
alewolf / gist:275278f1da379b56512d
Last active May 5, 2020 09:10
MaxMind GeoIP city locator for unbounce forms
<script type="text/javascript">
$( window ).load(function(){
$.getScript("//geoip-js.com/js/apis/geoip2/v2.1/geoip2.js", function() {
var onSuccess = function(geoipResponse) {
// change '#lp-pom-form-64 #city' to match your form ID and field name
$('#lp-pom-form-64 #city')[0].value = geoipResponse.city.names.en;
};
@alewolf
alewolf / gist:e6fcecfba548c765a4ad52d46abcd81e
Last active May 5, 2020 20:41
AdWords Script: Switch all broad match keywords to modified broad match
// Title: Modified Broad Match
// Descritpion: Switch all broad match keywords to modified broad match
// Author: Wolf+Bär Agency, Aleksandar Vucenovic
// License: GNU GPLv3
// Version: 0.3
// URL: https://gist.github.com/alewolf/e6fcecfba548c765a4ad52d46abcd81e
// URL:
// START Settings
@alewolf
alewolf / gist:5d933417e35a3d7585b96e2ada9f2e05
Last active July 15, 2020 05:48
resync variable product in WooCommerce
<?php
/***********************************************************************************************
* This function will automatically resync variable product prices in case the prices don't show
* on the catalogue pages anymore.
*
* Simply place it in functions.php
***********************************************************************************************/
add_filter( 'woocommerce_get_price_html', 'resync_variable_product', 100, 2 );
@alewolf
alewolf / gist:b37fbd2679afae7abac390090c76c63c
Last active August 25, 2020 11:14
Generic Keywords Remover
/**
* Title: Generic Keywords Remover
* Descritpion: Remove generic keywords from branded search campaigns
* Author: Wolf+Bär Agency, Aleksandar Vucenovic
* Website: https://wolfundbaer.ch
* License: GNU GPLv3
* Version: 0.2
* URL: https://gist.github.com/alewolf/b37fbd2679afae7abac390090c76c63c
* URL:
*/