-
Notifications
You must be signed in to change notification settings - Fork 758
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4255 from skamphuis/feature/add-google-tagmanager…
…-connector Feature/add google tagmanager connector
- Loading branch information
Showing
17 changed files
with
957 additions
and
0 deletions.
There are no files selected for viewing
135 changes: 135 additions & 0 deletions
135
DNN Platform/Connectors/GoogleTagManager/App_LocalResources/SharedResources.resx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<root> | ||
<!-- | ||
Microsoft ResX Schema | ||
Version 2.0 | ||
The primary goals of this format is to allow a simple XML format | ||
that is mostly human readable. The generation and parsing of the | ||
various data types are done through the TypeConverter classes | ||
associated with the data types. | ||
Example: | ||
... ado.net/XML headers & schema ... | ||
<resheader name="resmimetype">text/microsoft-resx</resheader> | ||
<resheader name="version">2.0</resheader> | ||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> | ||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> | ||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> | ||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> | ||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> | ||
<value>[base64 mime encoded serialized .NET Framework object]</value> | ||
</data> | ||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> | ||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> | ||
<comment>This is a comment</comment> | ||
</data> | ||
There are any number of "resheader" rows that contain simple | ||
name/value pairs. | ||
Each data row contains a name, and value. The row also contains a | ||
type or mimetype. Type corresponds to a .NET class that support | ||
text/value conversion through the TypeConverter architecture. | ||
Classes that don't support this are serialized and stored with the | ||
mimetype set. | ||
The mimetype is used for serialized objects, and tells the | ||
ResXResourceReader how to depersist the object. This is currently not | ||
extensible. For a given mimetype the value must be set accordingly: | ||
Note - application/x-microsoft.net.object.binary.base64 is the format | ||
that the ResXResourceWriter will generate, however the reader can | ||
read any of the formats listed below. | ||
mimetype: application/x-microsoft.net.object.binary.base64 | ||
value : The object must be serialized with | ||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter | ||
: and then encoded with base64 encoding. | ||
mimetype: application/x-microsoft.net.object.soap.base64 | ||
value : The object must be serialized with | ||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter | ||
: and then encoded with base64 encoding. | ||
mimetype: application/x-microsoft.net.object.bytearray.base64 | ||
value : The object must be serialized into a byte array | ||
: using a System.ComponentModel.TypeConverter | ||
: and then encoded with base64 encoding. | ||
--> | ||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> | ||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> | ||
<xsd:element name="root" msdata:IsDataSet="true"> | ||
<xsd:complexType> | ||
<xsd:choice maxOccurs="unbounded"> | ||
<xsd:element name="metadata"> | ||
<xsd:complexType> | ||
<xsd:sequence> | ||
<xsd:element name="value" type="xsd:string" minOccurs="0" /> | ||
</xsd:sequence> | ||
<xsd:attribute name="name" use="required" type="xsd:string" /> | ||
<xsd:attribute name="type" type="xsd:string" /> | ||
<xsd:attribute name="mimetype" type="xsd:string" /> | ||
<xsd:attribute ref="xml:space" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
<xsd:element name="assembly"> | ||
<xsd:complexType> | ||
<xsd:attribute name="alias" type="xsd:string" /> | ||
<xsd:attribute name="name" type="xsd:string" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
<xsd:element name="data"> | ||
<xsd:complexType> | ||
<xsd:sequence> | ||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | ||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> | ||
</xsd:sequence> | ||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> | ||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> | ||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> | ||
<xsd:attribute ref="xml:space" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
<xsd:element name="resheader"> | ||
<xsd:complexType> | ||
<xsd:sequence> | ||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> | ||
</xsd:sequence> | ||
<xsd:attribute name="name" type="xsd:string" use="required" /> | ||
</xsd:complexType> | ||
</xsd:element> | ||
</xsd:choice> | ||
</xsd:complexType> | ||
</xsd:element> | ||
</xsd:schema> | ||
<resheader name="resmimetype"> | ||
<value>text/microsoft-resx</value> | ||
</resheader> | ||
<resheader name="version"> | ||
<value>2.0</value> | ||
</resheader> | ||
<resheader name="reader"> | ||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
</resheader> | ||
<resheader name="writer"> | ||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> | ||
</resheader> | ||
<data name="btnDelete.Text" xml:space="preserve"> | ||
<value>Delete Connection</value> | ||
</data> | ||
<data name="ConnectorName.Text" xml:space="preserve"> | ||
<value>Google Tag Manager Core Connector</value> | ||
</data> | ||
<data name="TrackAdministrators.Text" xml:space="preserve"> | ||
<value>Track for Administrators:</value> | ||
</data> | ||
<data name="TrackingCodeFormat.ErrorMessage" xml:space="preserve"> | ||
<value>Tracking Code Cannot Be Empty</value> | ||
</data> | ||
<data name="GtmID.Text" xml:space="preserve"> | ||
<value>Tag Manager ID:</value> | ||
</data> | ||
</root> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div, .connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div { | ||
width: 100%; | ||
} | ||
|
||
#connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div input[type='text'], #connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div textarea, .connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div input[type='text'] { | ||
width: 65% !important; | ||
} | ||
|
||
#connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div label, .connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div label { | ||
width: 25% !important; | ||
} | ||
|
||
#connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div span, .connector-CoreGoogleTagManagerConnector > div.edit-fields > div > div span { | ||
font-size:0.75em; | ||
font-style:italic; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information | ||
|
||
namespace DNN.Connectors.GoogleTagManager | ||
{ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Web; | ||
|
||
/// <summary> | ||
/// Lists constants used across the connector. | ||
/// </summary> | ||
internal class Constants | ||
{ | ||
/// <summary> | ||
/// The path to the resource file used for localization. | ||
/// </summary> | ||
public const string LocalResourceFile = "~/DesktopModules/Connectors/GoogleTagManager/App_LocalResources/SharedResources.resx"; | ||
} | ||
} |
136 changes: 136 additions & 0 deletions
136
DNN Platform/Connectors/GoogleTagManager/Dnn.GoogleTagManagerConnector.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>8.0.30703</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{7B43D266-D6E1-4496-A9A1-487AFEE0D9C0}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>DNN.Connectors.GoogleTagManager</RootNamespace> | ||
<AssemblyName>DNN.Connectors.GoogleTagManager</AssemblyName> | ||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<DocumentationFile>bin\DNN.Connectors.GoogleTagManager.xml</DocumentationFile> | ||
<LangVersion>7</LangVersion> | ||
<NoWarn>1591</NoWarn> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<DocumentationFile>bin\DNN.Connectors.GoogleTagManager.xml</DocumentationFile> | ||
<NoWarn>1591</NoWarn> | ||
<LangVersion>7</LangVersion> | ||
<TreatWarningsAsErrors>false</TreatWarningsAsErrors> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Cloud_Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin</OutputPath> | ||
<DefineConstants>DEBUG;TRACE;CLOUD;CLOUD_DEBUG</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<DocumentationFile>bin\DNN.Connectors.GoogleTagManager.xml</DocumentationFile> | ||
<LangVersion>7</LangVersion> | ||
<NoWarn>1591</NoWarn> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Cloud_Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin</OutputPath> | ||
<DefineConstants>TRACE;CLOUD;CLOUD_RELEASE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<DocumentationFile>bin\DNN.Connectors.GoogleTagManager.xml</DocumentationFile> | ||
<NoWarn>1591</NoWarn> | ||
<LangVersion>7</LangVersion> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"> | ||
<HintPath>..\..\..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Net" /> | ||
<Reference Include="System.Net.Http" /> | ||
<Reference Include="System.Net.Http.Formatting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\..\..\Packages\Microsoft.AspNet.WebApi.Client.5.2.3\lib\net45\System.Net.Http.Formatting.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System.Web" /> | ||
<Reference Include="System.Web.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> | ||
<SpecificVersion>False</SpecificVersion> | ||
<HintPath>..\..\..\Packages\Microsoft.AspNet.WebApi.Core.5.2.3\lib\net45\System.Web.Http.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<AdditionalFiles Include="..\..\..\stylecop.json"> | ||
<Link>stylecop.json</Link> | ||
</AdditionalFiles> | ||
<None Include="GoogleTagManagerConnector.dnn" /> | ||
<None Include="Module.build" /> | ||
<None Include="packages.config" /> | ||
<None Include="GoogleTagManager.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\DotNetNuke.Instrumentation\DotNetNuke.Instrumentation.csproj"> | ||
<Project>{3cd5f6b8-8360-4862-80b6-f402892db7dd}</Project> | ||
<Name>DotNetNuke.Instrumentation</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\..\DotNetNuke.Web\DotNetNuke.Web.csproj"> | ||
<Project>{ee1329fe-fd88-4e1a-968c-345e394ef080}</Project> | ||
<Name>DotNetNuke.Web</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\..\Library\DotNetNuke.Library.csproj"> | ||
<Project>{6b29aded-7b56-4484-bea5-c0e09079535b}</Project> | ||
<Name>DotNetNuke.Library</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\..\Providers\FolderProviders\DotNetNuke.Providers.FolderProviders.csproj"> | ||
<Project>{b267ce88-dffc-4bd8-9962-319e79c52526}</Project> | ||
<Name>DotNetNuke.Providers.FolderProviders</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Analyzer Include="..\..\..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" /> | ||
<Analyzer Include="..\..\..\packages\StyleCop.Analyzers.1.1.118\analyzers\dotnet\cs\StyleCop.Analyzers.dll" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<EmbeddedResource Include="App_LocalResources\SharedResources.resx" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="Connector.css" /> | ||
<Content Include="connector.htm" /> | ||
<Content Include="Images\GoogleTagManager_32X32_Standard.png" /> | ||
<Content Include="License.txt" /> | ||
<Content Include="ReleaseNotes.txt" /> | ||
<Content Include="Scripts\connector.js" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Constants.cs" /> | ||
<Compile Include="GoogleTagManagerEngine.cs" /> | ||
<Compile Include="GoogleTagManagerController.cs" /> | ||
<Compile Include="GoogleTagManagerConnector.cs" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<Import Project="Module.build" /> | ||
</Project> |
34 changes: 34 additions & 0 deletions
34
DNN Platform/Connectors/GoogleTagManager/GoogleTagManager.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<AnalyticsEngineConfig> | ||
<Engines> | ||
<AnalyticsEngine> | ||
<EngineType>DotNetNuke.Services.Analytics.GoogleTagManagerEngine, DNN.Connectors.GoogleTagManager</EngineType> | ||
<ElementId>Head</ElementId> | ||
<InjectTop>False</InjectTop> | ||
<ScriptTemplate> | ||
<![CDATA[ | ||
<!-- Google Tag Manager --> | ||
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start': | ||
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0], | ||
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src= | ||
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f); | ||
})(window,document,'script','dataLayer','[GTM_ID]');</script> | ||
<!-- End Google Tag Manager --> | ||
]]> | ||
</ScriptTemplate> | ||
</AnalyticsEngine> | ||
<AnalyticsEngine> | ||
<EngineType>DotNetNuke.Services.Analytics.GoogleTagManagerEngine, DNN.Connectors.GoogleTagManager</EngineType> | ||
<ElementId>Body</ElementId> | ||
<InjectTop>True</InjectTop> | ||
<ScriptTemplate> | ||
<![CDATA[ | ||
<!-- Google Tag Manager (noscript) --> | ||
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=[GTM_ID]" | ||
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> | ||
<!-- End Google Tag Manager (noscript) --> | ||
]]> | ||
</ScriptTemplate> | ||
</AnalyticsEngine> | ||
</Engines> | ||
</AnalyticsEngineConfig> |
Oops, something went wrong.