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

Adwords campaign link #250

Open
mariosmaselli opened this issue Feb 16, 2018 · 10 comments
Open

Adwords campaign link #250

mariosmaselli opened this issue Feb 16, 2018 · 10 comments

Comments

@mariosmaselli
Copy link

Hey man!
soo.. something came up that I've bee not been able to tackle :( and maybe you can help me.

So the website is up and running and the client wanted to launch an Adwords campaign.. but the route doesn't match the url from Adwords.. then it doesn't load the right js file.. I believe that it only loads sections/default.js so site doesn't break, but functionalities from sections/home.js are not being loaded

Any idea how to fix this?

Thanks a lot!!!

@baptistebriel
Copy link
Owner

Hey @mariosmaselli,

What do you mean by "but the route doesn't match the url from Adwords"? Can you send over an example? We could try to console.log where it stops. 😅

Let me know!

@mariosmaselli
Copy link
Author

mariosmaselli commented Feb 17, 2018

Hi @baptistebriel

So the link from Adwords is something like this domain.com/?gclid=CjwKCAiAn5rUBRA3EiwAUCWb28kDRButKSW5-G_p0Rwn3T7Dazqkbvu-j2yahvb9i9p6qxy4VOOTnBoCxlwQAvD_BwE

And actually, if I do this... domain.com/?asdasdasd whatever it also doesn't work...

Does this make sense?

Not sure if it has a fix.. as I can see that it also happens on alisharaf for example after /diary/?dasdasdw

@mariosmaselli
Copy link
Author

mariosmaselli commented Feb 19, 2018

Ok.. I think that found a solution.. not sure if it's the best one but I believe this solves my problem

[${config.BASE}:id]: require('./sections/home')

Let me know if you come up with something else

UPDATE

Ok this breaks other pages 👎

For some reason, it seemed to work but is not... well let me know if there is an update on this. I will continue looking for a fix.

Thanks!

@baptistebriel
Copy link
Owner

Hey @mariosmaselli,

Indeed, I have the same issue on some projects. Have you thought about adding 404 to the routes object? See bigwheel official documentation: https://github.com/bigwheel-framework/documentation/blob/master/routes-special.md#404

Let me know if that works!

@mariosmaselli
Copy link
Author

Hi @baptistebriel

Yeah, I actually have it..
But for this specific case is for the Adwords campaign that I mentioned before...
So maybe a 301.. from the Adwords campaign link to the home page?

I don't see other solution at the moment :(

@baptistebriel
Copy link
Owner

The only suggestion I have so far would be to test the URL before calling framework.init(), see if there is a ? in the string and then just do a window.location = '/' or something?

@mariosmaselli
Copy link
Author

Hi @baptistebriel me again :D

I did what you recommended above but apparently, there are some discrepancies in the analytics given the redirect, is there any chance to leave the id in the url and no redirection?

Thanks!

@baptistebriel
Copy link
Owner

baptistebriel commented Aug 7, 2018

Hey @mariosmaselli,

I believe this is an issue more related to bw-router. I'm just using it to bind routes and therefore don't have much control on it. That's why I was recommending to test out the URL and see if there is a ? in it before starting up the framework. I believe keeping the ?gclid=id in the URL shouldn't do anything specific or shouldn't be needed for the data to be sent; we'd need to know at which point this data is sent to Google.

Do you have a repository where I could clone the project and do some tests locally? How does the Adwords data gets send to Google? Is it through Google Analytics?

@baptistebriel baptistebriel reopened this Aug 7, 2018
@mariosmaselli
Copy link
Author

Hi @baptistebriel

I just give you access to the repo, please let me know if you get it.

Yeah, I tried the redirection, but apparently, this is not a "good" solution, mostly because the data is duplicated. I'm not an expert on Ads or Analytics either so not sure why the ID is needed.

@baptistebriel
Copy link
Owner

Where is the dedicated code for Adwords? I guess the data is 'duplicated' because it's a hard redirection using window.location, and therefore the code is sent twice (I'm assuming this is like Google Analytics). You could try using bw-router's built-in function router.go('/') instead of doing a hard refresh. Does that makes sense?

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

2 participants