Pass Mediawiki "wgUserName" to Google Tag Manager - mediawiki

I have an install of Mediawiki for my company which I have tracking page activity currently, but I also want to be able to track page activity per user.
Ideally, I'd like to pass the wgUserName into Google Tag Manager as the userid that Google Analytics sees.
How can I pass the wgUserName into the data layer from the wiki? I just need to get that into Tag Manager.
Thanks!

I don't think you'll need the data layer for this, according to https://www.mediawiki.org/wiki/Manual:Interface/JavaScript
You can access the config via: mw.config and the value for "wgUserName" can be found with "mw.config.get("wgUserName")"
Thus all you need to do in GTM is create a Custom JavaScript variable and reference it:

Related

How to track clicks on Links using GTM

I have an ads campaign and I don't know from where users came to my website and
How can I know which one of those links users click must
www.example.com/twitter
www.example.com/whatsapp
www.example.com/linkdIn
www.example.com/<this will be the source name>
I want to know which link users came from using GTM.
All links must open on the landing page.
Thanks.
You don't really need GTM to track click source. The GA script translates certain query parameters to traffic source dimensions automatically. Those query parameters are called UTM parameters. Here's the documentation on how they're mapped to GA data.
You can use the url builder tool to generate a url if you find it difficult to figure out the proper syntax.
Basically, you just generate a link to your landing, embedding there the information about the source and then you post the link on the said source. And you carefully do that for all sources.
Sure, GA also tracks the referrer, but TLS will eraze the query params of the referrer, so it may be much more awkward to use to determine the source, but GA already tries to parse the referrers to determine the source automatically, when no utm params are set. UTMs will override the automatic referrer logic.
Finally, GTM. GTM is powerful. It allows you to do more than that. For example, it's able to override the above described logic and set the source, medium, keyword, even referrer, using JS. Ultimately, mostly because of GTM's ability to deploy custom JS, it is possible to override any field in tracking and add extra fields.

Import custom field options from one Infusionsoft app to another

I am trying to find a way to update a custom field automatically within multiple Partner Infusionsoft apps when I manually update the field with new options within our main Infusionsoft app.
The idea is to avoid manually logging into every Partner Infusionsoft app that we manage, individually, to update the custom field options so that they match our main app custom field options when it is updated. The custom field is constantly being updated with new options that need to be mirrored within all of our partner apps.
The process would not need to be entirely automatic. We could manage using a trigger to update the rest of the apps whenever we have manually updated the custom field in our main app.
Can anyone please steer me in the right direction or tell me if this isn't even possible?
Yes this is possible with the API. Unfortunately there isn't a REST webhook for when a custom field is modified, so it would require a constant poll against what you would consider the master application. Constantly check the custom field and see if it's values changed. This is the rest documentation for that:
https://developer.infusionsoft.com/docs/rest/#!/Contact/retrieveContactModelUsingGET
That will include all the possible options for the field.
Unfortunately you can't modify a custom field in the newer REST API so you will have to use xmlrpc. The rest API only let's you create according to the documentation.
Here are the docs for the endpoint you would use with xmlrpc to update all the other apps to match the master application.
https://developer.infusionsoft.com/docs/xml-rpc/#data
https://developer.infusionsoft.com/docs/table-schema/
DataFormField is the custom field information. You would use the data endpoint to modify the values.
Be careful when you are polling the master application to not go over usage limits and apply best practices.

Salesforce Development and configuration

I want to merge 6 different profiles into one, consolidating FLS, Record Type, Permission sets, Page layouts in salesforce. May I know whats the best possible and easiest way to do it?
Thanks
Use the Salesforce Metadata API to retrieve the 6 profiles in xml form. You can then view all the permissions each profile has and consolidate into one. Then use the Metadata API deploy() to deploy the profile to your Salesforce org.
Salesforce give examples on how to retrieve profiles and the required package.xml to include in the request here: https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_profile.htm
Note: the retrieval content of profiles is relative. i.e to see the profile permissions for Account object, you must include the Account object in your retrieve request.
Salesforce documentation:
https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/file_based.htm
https://developer.salesforce.com/docs/atlas.en-us.api_meta.meta/api_meta/meta_retrieve.htm

JSON storage via API

I'm hoping to store a JSON file and access it through javascript in a Qualtrics survey. The information does not need to be password protected and I don't want to include any credentials in the Qualtrics survey.
I've been using links to anonymous gists eg. (https://gist.githubusercontent.com/anonymous/591cf9b1dd8fa70d97451cd1569f89be/raw/9984f8f22929d29d6f612189212059bce5157ca4/a_file), but every time I update a gist, that link changes. So, every time I want to change the contents of the gist, I need to copy the new link into the Qualtrics survey Javascript (unfortunately, I can't do this automatically easily in Qualtrics).
I'd like to be able to post the JSON somewhere that I can update programmatically without changing the link. Does anyone have suggests of an API I can use for this purpose? Thanks a lot!
Why not use github's api to get your gist's content by using the gists id.
So for
https://gist.githubusercontent.com/anonymous/591cf9b1dd8fa70d97451cd1569f89be/raw/9984f8f22929d29d6f612189212059bce5157ca4/a_file
the id would be 591cf9b1dd8fa70d97451cd1569f89be and then you can make get requests to https://api.github.com/gists/591cf9b1dd8fa70d97451cd1569f89be. You may need to have public gists though, not anonymous gists to be able to update a gist and use it's id to track changes.

Add application to Fb Page from outside Fb, add tab for it and configure if with specific data?

I have a simple product catalogue for businesses. There is a catalogue's management interface for adding products. Each business has a unique domain name where all its products are listed.
I would like to extend catagloue's functionality and allow businesses to have their products listed on facebook.
Functionality of the facebook application:
- Each business can install application from catalogue's management interface (I would like to have a button that opens facebook in a new window and prompts user to authorize access to one of user's existing Facebook Pages)
- installing application adds a Tab on selected Facebook Page,
- by clicking on a Tab visitor of the Facebook Page is presented with a list of products specific for this business. Data for that page is dynamic and can be accessed with a REST call and presented as json or html.
We would like each business that have a product catalogue with us to install application and have it automatically configured to use specific domain name when requesting product data.
Is it all technically possible? Could you point me into the right direction on how to
- install application from external website
- configure that application with a parameter (perhaps passed in url when requesting application installation)
- automatically add Page Tab for this application
Cheers,
Michal
Yes it is possible. But it'll be a little different from what you are thinking, i guess.
I recently implemented code to add a tab to a page programmatically, it is as follows(in PHP) :
$tabAdded=$facebook->api("/".$id."/tabs","post", array("access_token" => $access,
"app_id" => $fbconfig['appid']));
From the code we see that we need an app id, an access token, and the page id($id). $facebook is an instance of the FacebookPHPSDK.
So here's how we can get the three things in question:
First app id, you'll need to create a Facebook page tab app, select Page Tab in the app's Basic settings (where you can mention the page tab url. This url will have the content for a page tab.) You'll also need to enable website because you need to ask the user for necessary permissions (namely manage_pages). For your specific requirement you have to give the domain of the catalogue management app.
Second page id and access token, once you have manage_pages permission you can query the graph api to get the pages of the user using : api('me/accounts') this returns data with page name, page category, page id, page access token for all the user's pages.
#thaddeusmt has already mentioned that you can't create new applications, and need to use the same app, you have to read the signed request and get the page id, and serve content. All that will be left to do is link your customer domains to the correct page ids.
Hope this was useful.
You can install/uninstall (add/remove) application tabs to/from Pages using the Facebook API:
http://developers.facebook.com/docs/reference/api/page/#tabs
You cannot create new applications, however. So you will need to use the same application for each Page.
The way you can show different content for each Page in the Tab (using the same application) is by checking the Signed Request. This contains the ID of the Facebook Page. The code that serves up your application Tab can look at the Page ID and serve up the appropriate content for that Page.
I hope this helps get you on the trail. Good luck!
Yes it is possible.
It's a two way process
First you have to get page_access_token through graphAPI.
www.facebook.com/?fields=access_token
This will return Page_access_token.
Use page access token and use post method
www.facebook.com/yourpageid/tabs/
Post Parameters:
app_id= 'YourAppID'
access_token = 'access_token'
That way you can add your facebook app into facebookPage.