Skip to content

Instantly share code, notes, and snippets.


Prasanna Sunil Kulkarni prasannakulkarni333

View GitHub Profile
View Scrape search results with google apps script
function scrapeGoogle() {
var searchResults=UrlFetchApp.fetch(""+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 / 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
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 =;
var _dr = _d.referrer;