Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there ability to add other tracking services? #17

Open
ronpearl opened this issue Jun 25, 2020 · 25 comments
Open

Is there ability to add other tracking services? #17

ronpearl opened this issue Jun 25, 2020 · 25 comments

Comments

@ronpearl
Copy link

We have added this plugin to our Gatsby site and currently it seems to work great. However, other sites we have worked on use different types of tracking systems along with GTM. Is there, or could there be added, a way to include other scripts to the process besides the 3 you have currently? Maybe a way to add a custom or pre-defined script to the optional loader as well?

@andrezimpel
Copy link
Owner

andrezimpel commented Jun 25, 2020 via email

@ronpearl
Copy link
Author

I am not sure. I see where you are loading the options and then updating on route change, maybe you could have the ability to load in a JSON file with a script URL and maybe some attributes for the script? So if a script URL is something like:

<script type="text/javascript" defer src="//someurl.com/t/12334325"></script>

Then we could load a JSON file with a format like:

{
    [
        {
            name: 'some url script',
            src: '//someurl.com/t/12334325',
            params: {
                defer: true,
                async: false,
                type: 'text/javascript'
            }
        }
    ]
}

This way it could be as simple as loading these scripts in dynamically as long as the user accepts. I'm sure there are other types of scripts that people would use, but this might just get it going!

@timoklok
Copy link

timoklok commented Nov 30, 2020

Hi, is there any progress on this? We would really like to see this feature in the plugin.

@andrezimpel
Copy link
Owner

Hi @ronpearl & @timoklok

I'm currently investigating this because I also have to use Hotjar for a client. I'm not quite sure what the best option would be because the plugin should not allow any tracking before the user accepts it. Also most tracking services actually use multiple script tags wich javascript not only one with a source.

@timoklok
Copy link

timoklok commented Dec 2, 2020

Although a generic solution is of course preferable, I'm personally also most interested in a Hotjar-implementation :-)

@nuttifox
Copy link

Is it possible to set some tracking scripts such as GA as core (required) so it tracks anomalously without the user clicking accept?

@andrezimpel
Copy link
Owner

@nuttifox actually I don't think this is not GDPR-compliant. You should never track somebody unless they gave their consent. Anomalously should fall under that category as far as I know. If you do not ask for the consent you could easily use another library or Gatsby plugin.

Ps.: If you really need to track users without giving their consent you could run your own analytics software (e.g. Matomo). This will then not require you to get the consent because the data stays within your organization and you are not sending them to a third party. At least that is what we found out thru research - I am no lawyer so I'd suggest to double confirm this before doing it.

See: https://github.com/react-ga/react-ga

@andrezimpel
Copy link
Owner

@timoklok, @ronpearl so the plugin should expose some configuration where you could add your own ssr and browser scripts? Would this make any sense? Just adding some source url will not work for all since some services will need ssr and you have to fire the track or init event in the browser.

@andrezimpel
Copy link
Owner

Quick update: I am rewriting the whole script. This should also allow to add custom services at some point!

@highnoondev
Copy link

Awesome! And also I just wanted to say you did a great job at the Gatsby Conf 2021.

@andrezimpel
Copy link
Owner

@highnoondev Thank you so so much!!!

@frodeste
Copy link

Can we contribute to the work? I would like to see Twitter, Linkedin and Dynamics Markerting additions as well.

@andrezimpel
Copy link
Owner

@frodeste sure thing!

@frodeste
Copy link

Great. I have a developer that I can involve in this, and following your v 2 strukture, I think supporting more services should be easy.

@andrezimpel
Copy link
Owner

Awesome! Yea my goals was to have a reusable approach how services are added. This could also be used for services that are defined in the gatsby-config.js.

@frodeste
Copy link

frodeste commented Mar 13, 2021

I have created a fork to my repo, and added the core parts for Dynamics Marketing. I have asked my team to complete the work.
I invited @andrezimpel to the repo so that you can track progress and comment as you see fit :)

@frodeste
Copy link

What else is need before v 2 is done @andrezimpel

@frodeste
Copy link

frodeste commented Mar 13, 2021

A brief update. I moved the fork to our company https://github.com/ProsessPilotene/gatsby-plugin-gdpr-cookies to allow my team have full access.. @andrezimpel you have access as well now.

The Dynamics 365 Marketing service is added as a feature branch https://github.com/ProsessPilotene/gatsby-plugin-gdpr-cookies/tree/feature/DynamicsMarketing

@andrezimpel
Copy link
Owner

@frodeste, the remaining goal for v2 is to clean up the GTM service.

I have a look at your fork, thanks! There is a lot of duplicate code right now, so another goal (for v2.1) would be have a a single implementation which is only reading data from config. This would also make it way easier to implement other services.

I am also working on a consent banner.

@frodeste
Copy link

I will talk to my team tomorrow and hopefully start to contribute to this project. Let us know how you are done on the architecture.

As to a consent banner. Take a look at https://dev.gartnerhallen.no/. This is a consent banner that we recently finished for a client (and we are still working on the rest of the site.)

@frodeste
Copy link

We will start our work in about one weeks time.

@yepes
Copy link

yepes commented May 20, 2021

Hi guys. Any update on this? Let's say I need to add a trackjs script, is it possible right now?

@andrezimpel
Copy link
Owner

Hi @yepes it's not 100% done yet. But v2 of the plugin only needs some minor adjustments to support this. I keep you updated!

@chssch
Copy link

chssch commented Jun 5, 2021

Thanks for the plugin., If it's of interest for anybody else, I've added LinkedIn support here:
https://github.com/chssch/gatsby-plugin-gdpr-cookies
A general configurable system would be of course nice. Looking forward.

@kapy9612
Copy link

Is there any possibility to add SharpSpring integration to this plugin?
https://www.gatsbyjs.com/plugins/gatsby-plugin-sharpspring/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants