Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Prasanna Sunil Kulkarni prasannakulkarni333

🎯
Focusing
View GitHub Profile
View Scrape search results with google apps script
function scrapeGoogle() {
var searchResults=UrlFetchApp.fetch("https://www.google.co.in/search?q="+encodeURIComponent("amarindaz youtube channel"));
var titleExp=/<h3 class=\"r\">([\s\S]*?)<\/h3>/gi;
var titleResults=searchResults.getContentText().match(titleExp);
// Logger.log(titleResults);
for(var i in titleResults)
@prasannakulkarni333
prasannakulkarni333 / Wordpress Data Layer Variables
Created Sep 24, 2017 — forked from BryanBarrera/Wordpress Data Layer Variables
Modified Wordpress datalayer variables for pulling: author names, post types, categories, page name, and dates into custom variables for the classic version of Google Analytics. Feel free to leave a comment or hit me up http://BryanBarrera.com
View Wordpress Data Layer Variables
// Add this script after you make your dataLayer = []; call
// AND after your GTM code snippet
// This needs to go inside the header.php in order for it work globally across your site
<script type="text/javascript">
// URL toolbox - helps grabbing elements in the URL
var _d = document;
var _dl = _d.location;
var _dlp = _dl.pathname;
var _dls = _dl.search;
var _dr = _d.referrer;