UTM parameters not set for my website with Firebase dynamic links - firebase

I have a need to shorten my website url and I choose Firebase Dynamic Links (https://firebase.google.com/docs/dynamic-links) for that. I also added UTM parameters while creating the link.
When clicked on the link, the user is redirected to the desired website, but these parameters are not getting passed to it. Hence by GA for the website doesn't track it.
Am I doing something wrong? Or Is Dynamic Links a bad choice for my use case?

UTM parameters that you choose in UI are parameters for mobile tracking. If you want to pass UTM parameters to your "fallback" website, you need to add them to the fallback address itself.
So to be covered in all cases you'd need to add UTM parameters in UI configuration (or as normal UTM parameters) and inside fallback link, for example:
Let's say those are your UTM params:
utm_campaign=spring_sale&utm_medium=cpc&utm_source=google
Your current link:
https://sample.page.link/?link=http://example.com?utm_campaign%3Drandom&apn=com.demo.firebase&utm_campaign=spring_sale&utm_medium=cpc&utm_source=google
Your new link with UTM embedded in web link (https://example.com?utm_campaign=spring_sale&utm_medium=cpc&utm_source=google):
https://sample.page.link/?link=https://example.com?utm_campaign%3Dspring_sale%26utm_medium%3Dcpc%26utm_source%3Dgoogle&apn=com.demo.firebase&utm_campaign=spring_sale&utm_medium=cpc&utm_source=google

Related

How UTM paramters reach to Google Analystics Website

I am bit confused, and need little help regarding UTM tracking parameters.
Standard syntax of UTM url is:
http://www.example.com/?utm_source=adsite&utm_campaign=adcampaign.
Lets say I embed this url as a link in my page. User clicks this link. Link is pointing to my website.
All utm parameters would reach to my website. How do they will reach to Google analytics website.
My guess is, Analytics code and js intercept all link clicks and extract UTM params and then let user defined click handler work with the click.
Could someone with right expertise would help me?.
Thank you very much for your time, really appreciated.
The UTM require following mandatory parameters:
http://www.example.com/?utm_source=adsite&utm_medium=admedium
utm_source and utm_medium are mandatory.
utm_campaign is not mandatory even if the documentation says otherwise.
Google Analytics automatically collects these parameters and automatically removes them from the URL so in Google Analytics you will see the URLs without parameters and the source / medium of the UTM.

Escape a Shebang /#!/ in URL for Google URL Builder

Does anyone know if/how I can escape the shebang or encode the uri to make a link work properly in google analytics url builder? I want to add campaign parameters to product page urls to track ads success. The url for each individual product page looks like this:
http://www.oursite.com/classic-movies/#!/Title-of-Movie/p/12345678
When I put the product page url into the url builder, it says the url is invalid. I think it is because of the #!. I have tried escaping out the special characters, replacing the shebang with %23%21 or %21!
It appears valid in the url builder, and the builder generates a link with utm tags, BUT when you paste the tagged link into the browser, it does not take you to our product page. It takes you to our website, but gives a "sorry does not exist" message.
I also tried this:
http://www.oursite.com/classic-movies/?_escaped_fragment_=/Title-of-Movie/p/12345678
It generates a link in the builder and does link to the product page of our website (yay!), but the url adds this after the campaign name: #!/Title-of-Movie/p/1234567
The shebang is back! Will that be a problem?
For reference, we're using the Ecwid storefront plugin for a wordpress site.
Thanks in advance.
Short answer
You should use the URL without fragment (hash part) as a base for building URLs with queries (the part starting with '?') and then append the hash part to the end of URL.
Example:
1) Take http://www.example.com/classic-movies/#!/Title-of-Movie/p/12345678
2) Remove hash part: http://www.example.com/classic-movies/
3) Use this hash-free URL as a base and add query parameters yourself or use any automatic builder. Example: http://www.example.com/classic-movies/?utm_source=myblog&utm_campaign=xyz&abc=def
4) Append the hash part to the end of the URL: http://www.example.com/classic-movies/?utm_source=myblog&utm_campaign=xyz&abc=def#!/Title-of-Movie/p/12345678
You're done – the final URL is valid URL which will work fine for browser/customer, your site server and tracking tools like Google Analytics
Long answer
1) URLs could be very different, but their structure is actually quite the same and that's a part of the web standards.
URL is built this way:
protocol://site/path?query#fragment
(I simplified it and take in consideration only the parts we're talking about, the actual scheme is a bit more complicated)
Taking your product page URL, that will be:
protocol: http
site: www.example.com
path: classic-movies/
query: (empty)
fragment: !/Title-of-Movie/p/12345678
Now, if you want to add query parameters, you know where to insert them. As to the fragment part, it should be always in the end, regardless of whether it contains !
2) Google Analytics doesn't track the fragment parts of the URLs.
Urls like http://www.example.com/coolpage and http://www.example.com/coolpage#!anyparameter=anyvalue are the same for Goolgle Analytics. That's likely the reason why their URL builder tool doesn't accept that.
By the way, Ecwid uses fragment part of the URL all the time to address the product and category pages, but that's not an issue if you want to track your product pages in Google Analytics. Ecwid solved that problem by sending special 'virtual' page views to Google Analytics every time a customer browses your store. So in your GA reports you will see your store pages.
3) If you use Google Adwords for your ad campaigns, I'd suggest linking your Google Analytics and Google Adwords profiles to have better picture of customer behavior and the campaign performance. Check out this thread on Ecwid forums for the details:
http://www.ecwid.com/forums/showthread.php?t=10835

How to show pages visited during sessions marked with a custom variable in Google Analytics?

I embed custom links into each resume I send out, so I can see who as clicked on the links. I then take the custom value (passed through a url parameter) and pass it into Google Analytics as a session level custom variable. What I want to do is create a report that will show me all the typical information I can normally see (pages visited, time, etc), but filtered down by custom variables. i.e. I want to see that people form company X have looked at these parts of my website. I've been reading through all the documentation and feel like a custom report is the right way to go, but I'm not really sure. Any suggestions, links, instructions would be appreciated.
Create a custom report. Play around with some configuration like the following:

wordpress - how let users add location on a map?

I'm using Wordpress to build my website, i want to add a form that will have: name, description, image and location on a map. that is letting the users add their own marker on a map.
and by pressing 'submit' the whole data (name, description, image, longitude, latitude) would be saved to a database.
how can i do that? which plugins should i use?
You could use Google Placemarks and give them access to the creation of the 'Placemarks' custom post type that plugin utilises. You might have to hack the featured image..
Alternatively, you're looking at full custom post type creation and google maps API integration, a custom loop that utilises of the featured image.
Plugin that comes closest to what you need is what SMacFadyen suggested - BGMP. But if you want to do that yourself you would need to look into this:
Google Maps JavaScript API
WordPress Custom Post Types
WordPress Meta Boxes
For the first one there is lots of tutorials on how to display map and InfoWindows so you shouldn't have much problem with that. For Custom Post Types there is an awesome generator which should do 99% of your work. For Meta Boxes you can go several ways:
plugin - easiest but you would depend on a plugin which I don't like very much
from scratch - tutorial - which is a lot better than plugin but requires a lot of work
one of the meta box libraries - this is the way I usually go - I'm developing my own but it's not ready yet so in the mean time I would recommend My-Meta-Box or Reusable Custom WordPress Meta Boxes
Several times, when searching how to make this work, I stumbled upon this thread. Every time, I wasn't really happy with the way existing plugins deal with this. So, I now put this together myself.
Here's an overview of my solution.
Use the plugin Custom Post Type UI to create a custom post type for the markers on the map.
Use the plugin Advanced Custom Fields to add a field to this custom post type which represents the location. The field type is of type 'Google Map'.
Copy the standard Google Maps API clustering example to the appropriate theme file in your theme.
For showing your markers, generate the list of locations by, in your theme file, requesting the posts of your newly created custom post type.
For each marker/location, pick up the 'Google Map' field and abstract the latitude and longitude.
For each marker/location, construct the appropriate array element for the array with all locations, with, at least, the latitude and the longitude, and probably also the contents of an infowindow.
This should give you a map with all locations plotted out.
To allow users to add locations:
Add a listener to your map that listens for clicks and returns the location clicked. Perhaps this listener is only running after the user has expressed his intent to add a location to the map.
When the user has clicked, open a form, for example in a modal. The form should contain hidden fields with the latitude and longitude and could, for example, also contain a static image of the relevant location. Other form fields would be the fields you need for your purpose.
Submit the form using AJAX. Refer, for example, to this tutorial. In your theme's functions.php, you can then validate the submission and add the new submission to your Wordpress database, matching your new custom post type.
Depending on how you store your new location, on your next map reload, the new location will be included. (Or you perhaps need to authorise the new location, first.)
You can also reload all locations through AJAX.
Profile Builder allows you to do just that. Create a front-end register form including the required custom fields and a map field for users to pin or enter their location.
Then using the built-in User Listing (Member Directory) module, you can display a map of all users locations.

Custom Google Campaign Tracking

I'm building out a site that has predefined affiliate ids that are driving traffic to our sites. We currently use this paramater to track our seo work internally. Now we want to do the same through Google's Campaign Tracking at the Session level. The problem is we don't want to change our url, is it possible to manually build the Google campaign tracking pixel url? I'd like to take our affiliate ids and convert them over to a tracking campaign pixel for Google.
Seems like Google built this so all the tracking data must be in the url, is there a way to do the same tracking w/o the google data in the url?
Instead of:
http://www.mypage.com/?utm_source=google&utm_medium=cost-per-click
I want to use(javascript will do the rest):
http://www.mypage.com/?affid=123456
Turns out here is exactly what I was looking for:
https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiCampaignTracking
This is essentially doing everything the Google Campaign Tracking does but you have full control over what parameters are passed in the tracking pixel. I don't have to change or mess with the url, our in house tracking will work as it should, and now the google tracking pixel will be built as I specified.
You can programmatically set up a virtual pageview based on the affiliate id.
In an if statement, determine if you have an affiliate id. If you do, write some logic to build out the proper campaign, medium and source, then concatenate it to your URL. Pass that to GA via the trackPageview method instead of letting it do it's own thing.
Keep in mind that passing a virtual URL does replace it's default behavior, so you won't have the affid parameter in your content reports unless you build it in to the virtual pageview.

Resources