parsely / gatsby-plugin-parsely-analytics Goto Github PK
View Code? Open in Web Editor NEWGatsby plugin that adds Parse.ly Analytics to your site.
License: MIT License
Gatsby plugin that adds Parse.ly Analytics to your site.
License: MIT License
I have noticed behavior where the metadata sent on a pageview event is incorrect. Instead, the metadata is from the previous page.
Effectively, the plug-in is sending a pageview event for before the tracker can execute metadata extraction. In cases of dynamic page refreshes, the metadata that's already there (the previous page's metadata) is sent in the pageview event. Gatsby i
(shout out Josh R for investigating and identifying the failure point when I was at wit's end.)
Luckily, GA has the same issues. I've adapted their solution to our case.
I do not have write permissions for this repo, so I am replicating the work here.
Git hash to cherry pick: git cherry-pick 6529efc
gatsby-browser.js
[...]
const params [...]
[...]
// wrap in a timeout to give metadata extraction and react-helmet time to execute
// adapted from gatsby-plugin-google-analytics
// https://github.com/gatsbyjs/gatsby/blob/2753c4d75e909699348c4f871f0dbfaee7db37ab/packages/gatsby-plugin-google-analytics/src/gatsby-browser.js#L13
const sendPageView = () => {
if (options.parselyTrackPageViewExists) {
window.PARSELY.beacon.trackPageView(params);
} else {
window.PARSELY.pageviewQueue.push(params);
}
};
// Minimum delay for reactHelmet's requestAnimationFrame
setTimeout(sendPageView, 32);
return null;
};
// EOF
Aside: once this is fixed I'll add Parse.ly to the Gatsby Analytics providers page.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.